This repository has been archived by the owner on Nov 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
88 lines (83 loc) · 1.78 KB
/
compose.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
version: '3.9'
services:
nginx:
image: nginx:1.26.0-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d/:/etc/nginx/
depends_on:
- backend
networks:
- draft-backend-network
backend:
build:
context: ./src
dockerfile: ./Dockerfile
target: dev
volumes:
- ./src:/usr/src/app
ports:
- "8000:8000"
tty: true
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
migration:
condition: service_completed_successfully
networks:
- draft-backend-network
postgres:
image: postgres:16.2-alpine3.18
restart: always
# command:
# - "postgres"
# - "-c"
# - "log_destination=stderr"
# - "-c"
# - "log_statement=all"
# - "-c"
# - "log_connections=on"
# - "-c"
# - "log_disconnections=on"
# if not POSTGRES_USER and POSTGRES_DB, it will be "postgres".
env_file:
- .env
ports:
- 5432:5432
volumes:
- ./tmp/db/data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-q", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"]
interval: 1s
timeout: 1s
retries: 5
networks:
- draft-backend-network
redis:
image: redis:7.2.3-alpine3.18
restart: always
ports:
- 6379:6379
volumes:
- ./tmp/cache/data:/var/lib/redis/data
networks:
- draft-backend-network
migration:
build: ./migrations
depends_on:
postgres:
condition: service_healthy
volumes:
- ./migrations/db:/go/src/db
env_file:
- .env
networks:
- draft-backend-network
networks:
draft-backend-network:
driver: bridge
external: true