-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (109 loc) · 3.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
115 lines (109 loc) · 3.28 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
108
109
110
111
112
113
114
115
services:
nur-api: # This is the main API service (previously named "web")
container_name: nur-api
build: ./nur-io/django_api/.
ports:
- "${API_PORT}:9900" # Uses the API_PORT variable from the .env file
env_file:
- .env # Declares the .env file here
volumes:
- ./nur-io/django_api/.:/app
- nur-api_data:/app/data
- media_files:/app/media # Share media files with nginx
- ./nur-io/django_api/public:/app/public_idistrict # Idistrict mobility/climate data (create_data)
- ./otef-interactive/frontend/data:/app/otef-interactive/frontend/data # Mount model images
- ./otef-interactive/public:/app/public # Mount public directory for serving processed layer files
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 9900 || exit 1"]
interval: 5s
timeout: 5s
retries: 10
start_period: 120s
command:
[
"sh",
"-c",
"chmod +x /app/init.sh && /app/init.sh",
]
networks:
- nur_core
dashboard-builder:
container_name: dashboard_builder
build:
context: ./nur-front/frontend
dockerfile: Dockerfile
args:
- REACT_APP_MAPBOX_ACCESS_TOKEN=${REACT_APP_MAPBOX_ACCESS_TOKEN}
environment:
- REACT_APP_MAPBOX_ACCESS_TOKEN=${REACT_APP_MAPBOX_ACCESS_TOKEN}
env_file:
- .env
volumes:
- dashboard_build:/app/build-volume # Mount the volume to share the build
networks:
- nur_core
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: nginx-front
env_file:
- .env
volumes:
- ./nur-projection/frontend:/usr/share/nginx/html/nur-projection/frontend
- ./nur-remote-controller/frontend:/usr/share/nginx/html/nur-remote-controller/frontend
- ./otef-interactive/frontend:/usr/share/nginx/html/otef-interactive/frontend
- ./otef-interactive/public:/usr/share/nginx/html/otef-interactive/public
- dashboard_build:/usr/share/nginx/html/nur-front/frontend
- media_files:/usr/share/nginx/html/media # Mount the shared media volume
ports:
- "${FRONT_PORT}:80"
depends_on:
nur-api:
condition: service_healthy
dashboard-builder:
condition: service_started
restart: always # Add restart policy to ensure it restarts if it crashes
networks:
- nur_core
db:
container_name: db
image: postgres:latest
env_file:
- .env
volumes:
- postgres_data_core:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- nur_core
redis:
image: redis:alpine
container_name: redis-cs
# ports:
# - "6379:6379"
restart: always
networks:
- nur_core
networks:
nur_core:
name: nur_core
driver: bridge
driver_opts:
com.docker.network.bridge.name: nur_core
labels:
com.docker.compose.network: "nur_core"
# This ensures the network is recreated if it exists
external: false
volumes:
postgres_data_core:
dashboard_build:
nur-api_data: # New volume for persistent nur-api data
media_files: # New volume for sharing media files