-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (48 loc) · 1.11 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:
db:
image: postgres:15
volumes:
- db_data:/var/lib/postgres/data
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
PGDATA: /var/lib/postgres/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER}" ]
interval: 1s
timeout: 5s
migrator:
build: tern
command:
- migrate
- --conn-string
- postgres://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}
- --migrations
- /migrations
depends_on:
db:
condition: service_healthy
server:
build: .
restart: always
ports:
- "8080:8080"
environment:
DB_URL: postgres://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}
PORT: 8080
JWT_SECRET: ${JWT_SECRET}
JWT_ACCESS_EXPIRATION: ${JWT_ACCESS_EXPIRATION}
ADMIN_NAME: ${ADMIN_NAME}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
LOCAL: ${LOCAL}
LOG_LEVEL: ${LOG_LEVEL}
depends_on:
- migrator
volumes:
db_data: