-
Notifications
You must be signed in to change notification settings - Fork 2
/
compose.yaml
68 lines (67 loc) · 1.55 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
services:
frontend:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
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
- /app/.next/cache # Ensure the Next.js cache is properly mounted
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- .env
environment:
- PYTHONPATH=/backend:/
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/backend
db_test:
image: postgis-custom
build:
context: ./backend/database
dockerfile: Dockerfile
container_name: my_postgis_db_test
restart: always
env_file:
- .env
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}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
db:
image: postgis-custom
container_name: my_postgis_db
restart: always
env_file:
- .env
volumes:
- db-data:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
db-data: