-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (52 loc) · 1.18 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
version: "3"
services:
server:
build:
context: .
args:
NPM_LOG_LEVEL: notice
ports:
- "${SERVER_PORT}:3000"
environment:
POSTGRESQL_URL: "postgres://${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}@db:5432"
BCRYPT_SALT: "${BCRYPT_SALT}"
JWT_SECRET_KEY: "${JWT_SECRET_KEY}"
JWT_EXPIRATION: "${JWT_EXPIRATION}"
depends_on:
- migrate
migrate:
build:
context: .
args:
NPM_LOG_LEVEL: notice
command: npm run db:init
working_dir: /app/server
environment:
POSTGRESQL_URL: "postgres://${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}@db:5432"
BCRYPT_SALT: "${BCRYPT_SALT}"
depends_on:
db:
condition: service_healthy
db:
image: postgres:12
environment:
POSTGRES_USER: ${POSTGRESQL_USER}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD",
"pg_isready",
"-q",
"-d",
"${POSTGRESQL_DB_NAME}",
"-U",
"${POSTGRESQL_USER}",
]
timeout: 45s
interval: 10s
retries: 10
volumes:
postgres: ~