-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcompose.yaml
More file actions
107 lines (102 loc) · 2.5 KB
/
compose.yaml
File metadata and controls
107 lines (102 loc) · 2.5 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Docker Compose configuration for local development and CI pipeline.
# Not used for production; production is deployed via hosting platform.
services:
db:
image: postgis-custom
build:
context: ./backend/database
dockerfile: Dockerfile
container_name: my_postgis_db
restart: always
env_file:
- .env
environment:
- ENVIRONMENT=dev_docker
volumes:
- db-data:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_interval: 10s
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
db_test:
build:
context: ./backend/database
dockerfile: Dockerfile
container_name: my_postgis_db_test
restart: always
env_file:
- .env
environment:
- ENVIRONMENT=dev_docker
volumes:
- ./backend/database:/docker-entrypoint-initdb.d # Mount the SQL scripts directory
ports:
- 5433:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_interval: 10s
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
depends_on:
- db
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- .env
environment:
- PYTHONPATH=/backend:/
- DATA_GEOJSON_PATH=/public/data/
- ENVIRONMENT=dev_docker
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/backend
- ./backend/etl/startup.sh:/startup.sh
- public_data:/public/data
command: bash /startup.sh
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1"]
start_interval: 10s
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
frontend:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
environment:
- ENVIRONMENT=dev_docker
ports:
- 3000:3000
depends_on:
- backend
volumes:
- .:/app:rw,delegated # Mount after dependencies are installed
- /app/node_modules # This excludes the node_modules from being overwritten
- nextjs_cache:/app/.next
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
start_interval: 10s
interval: 10s
timeout: 5s
retries: 6
start_period: 60s
volumes:
db-data:
nextjs_cache:
public_data: