-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
43 lines (41 loc) · 1.02 KB
/
docker-compose.dev.yml
File metadata and controls
43 lines (41 loc) · 1.02 KB
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
services:
app:
depends_on:
db:
condition: service_healthy
links:
- db
db:
image: postgres:17.0
container_name: tgtime-api-db
restart: always
ports:
- "${DATABASE_PORT:-5432}:5432"
volumes:
- data:/var/lib/postgresql/data
- ./init.sql:/docker/db/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
networks:
tgtime-api-network:
aliases:
- database
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
start_period: 1s
migrate:
image: migrate/migrate
networks:
- tgtime-api-network
volumes:
- ./db/migrations:/migrations
command: ["-path", "/migrations", "-database", "postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@db:${DATABASE_PORT}/${DATABASE_NAME}?sslmode=${DATABASE_SSL_MODE}", "up"]
links:
- db
volumes:
data: