-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yml
66 lines (63 loc) · 1.34 KB
/
docker-compose-dev.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
version: "3.9"
services:
web:
build:
context: ./web
target: build
args:
work_dir: $WORK_DIR
ports:
- 8000:8000
volumes:
- ./web:${WORK_DIR}:cached
# exclude from sync
- ${WORK_DIR}/elm-stuff
api:
build:
context: ./api
target: dev
args:
cmd_help_dir: $CMD_HELP_DIR
work_dir: $WORK_DIR
ports:
- ${API_PORT}:${API_PORT}
environment:
ENV_FILES: /run/secrets/api
secrets:
- api
volumes:
- ./api:${WORK_DIR}:cached
# exclude from sync
- ${WORK_DIR}/target
depends_on:
- db
restart: on-failure
# One-off container, only on first compose up with db.
# migration:
# build:
# context: ./api
# target: migration
# command: bash -c 'diesel migration run --database-url $$(cat /run/secrets/db-connection)'
# secrets:
# - db-connection
# depends_on:
# - db
# restart: on-failure
db:
image: postgres:13-alpine
volumes:
- db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/db-password
secrets:
- db-password
restart: always
volumes:
db:
secrets:
api:
file: ${SECRETS_DIR}/api.env
db-connection:
file: ${SECRETS_DIR}/db-connection.txt
db-password:
file: ${SECRETS_DIR}/db-password.txt