-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (49 loc) · 1.14 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
version: '3.7'
services:
api:
build:
context: ./api
secrets:
- db_user
- db_password
- db_name
- hash_salt
- token_secret
command: ./api
--db-user-file="/run/secrets/db_user"
--db-password-file="/run/secrets/db_password"
--db-name-file="/run/secrets/db_name"
--db-server="db"
--hash-salt-file="/run/secrets/hash_salt"
--token-secret-file="/run/secrets/token_secret"
depends_on:
- db
ports:
- 8000:8000
restart: always
db:
image: postgres:11.2-alpine
secrets:
- db_user
- db_password
- db_name
environment:
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DATABASE_FILE: /run/secrets/db_name
ports:
- 5432:5432
volumes:
- ./db/data:/var/lib/postgresql/data:delegated
restart: always
secrets:
db_user:
file: ./secrets/db_user.txt
db_password:
file: ./secrets/db_password.txt
db_name:
file: ./secrets/db_name.txt
hash_salt:
file: ./secrets/hash_salt.txt
token_secret:
file: ./secrets/token_secret.txt