forked from cogini/phoenix_container_example_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
190 lines (179 loc) · 4.4 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
version: '3.8'
services:
app:
build:
context: .
dockerfile: deploy/Dockerfile.alpine
args:
BUILDKIT_INLINE_CACHE: "1"
MIX_ENV: prod
REGISTRY: ${REGISTRY}
target: deploy
depends_on:
db:
condition: service_started
environment:
- SECRET_KEY_BASE
- DATABASE_URL
- DATABASE_HOST=db
- DATABASE_DB
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- AWS_DEFAULT_REGION
# image: "${REGISTRY}cogini/foo-app"
image: "${REPO_URL}:${IMAGE_TAG}"
# platform: "linux/arm64"
# platform: "linux/amd64"
ports:
- "4000:4000"
app-debian:
build:
context: .
dockerfile: deploy/Dockerfile.debian
args:
BUILDKIT_INLINE_CACHE: "1"
MIX_ENV: prod
REGISTRY: ${REGISTRY}
target: deploy
depends_on:
db:
condition: service_started
environment:
- SECRET_KEY_BASE
- DATABASE_URL
- DATABASE_HOST=db
- DATABASE_DB
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- AWS_DEFAULT_REGION
image: "${REPO_URL}:${IMAGE_TAG}"
ports:
- "4000:4000"
# platform: "linux/arm64"
# platform: "linux/amd64"
# image: "${REGISTRY}cogini/foo-app"
codebuild:
# Custom build image for AWS CodeBuild
build:
context: .
dockerfile: deploy/Dockerfile.codebuild
args:
BUILDKIT_INLINE_CACHE: "1"
REGISTRY: ${REGISTRY}
image: "${REGISTRY}foo-app-ecs-build:latest"
# https://github.com/docker-library/docs/blob/master/postgres/README.md
db:
build:
context: .
dockerfile: deploy/Dockerfile.postgres
args:
REGISTRY: ${REGISTRY}
environment:
# POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
expose:
- "5432"
image: app-db
# image: postgres:latest
restart: always
volumes:
- ./tmp/db:/var/lib/postgresql/data
dev:
build:
context: .
dockerfile: deploy/Dockerfile.debian
args:
BUILDKIT_INLINE_CACHE: "1"
MIX_ENV: dev
REGISTRY: ${REGISTRY}
target: dev
# command: /bin/bash -c /app/bin/app-start-dev
# command: /app/bin/app-start-dev
# command: /bin/sh -c "/app/_build/prod/rel/app/bin/app foreground"
# VSCode devcontainer needs something running
# command: ["tail", "-f", "/dev/null"]
# command: ["sleep", "infinity"]
# command: /bin/sh -c "while sleep 1000; do :; done"
command: mix phx.server
depends_on:
db:
condition: service_started
environment:
- MIX_ENV=dev
- SECRET_KEY_BASE
- DATABASE_URL
- DATABASE_HOST=db
- DATABASE_DB
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- AWS_DEFAULT_REGION
image: foo-app-dev
ports:
- "4000:4000"
stdin_open: true
tty: true
volumes:
- ".:/app:delegated"
# - 'nfsmount:/app'
mssql:
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: some!Password
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- "1433:1433"
mysql:
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
# MYSQL_ROOT_PASSWORD: example
# command: --default-authentication-plugin=mysql_native_password
image: "${REGISTRY}mysql:8"
ports:
- "3306:3306"
postgres:
environment:
POSTGRES_PASSWORD: postgres
image: "${REGISTRY}postgres:12"
ports:
- "5432:5432"
test:
build:
context: .
dockerfile: deploy/Dockerfile.alpine
# dockerfile: deploy/Dockerfile.debian
args:
BUILDKIT_INLINE_CACHE: "1"
MIX_ENV: test
REGISTRY: ${REGISTRY}
target: test
# command: sh -c 'while !</dev/tcp/db/5432; do sleep 1; done; set -ex mix test'
# command: sh -c 'mix test'
depends_on:
db:
condition: service_started
environment:
- MIX_ENV=test
- DATABASE_URL
- DATABASE_HOST=db
- DATABASE_DB
image: app-test
vuln:
build:
context: .
dockerfile: deploy/Dockerfile.alpine
# dockerfile: deploy/Dockerfile.debian
args:
BUILDKIT_INLINE_CACHE: "1"
REGISTRY: ${REGISTRY}
target: vuln
image: app-vuln
# volumes:
# nfsmount:
# driver: local
# driver_opts:
# type: nfs
# o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
# device: ":${PWD}"