-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.prod.yml
102 lines (95 loc) · 2.83 KB
/
docker-compose.prod.yml
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
services:
postgresql:
image: postgres:16.0-alpine
container_name: predico_postgresql
restart: always
env_file:
- api/.env
ports:
- "5432:5432"
volumes:
- postgresql-data:/var/lib/postgresql/data
networks:
- predico_network
app: &api
build: api
container_name: predico_rest_app
environment:
- WAIT_HOSTS=postgresql:5432
restart: unless-stopped
command: gunicorn -c gunicorn.conf api.wsgi:application --forwarded-allow-ips="*" -b :8000
depends_on:
- postgresql
env_file:
- api/.env
networks:
- predico_network
volumes:
- static_volume:/usr/src/django/api/staticfiles
- media_volume:/usr/src/django/api/mediafiles
- ./api/files:/usr/src/django/files
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
REACT_APP_API_URL: https://localhost/api/v1 # This is the URL of the REST API
REACT_APP_BASE_URL: https://localhost # This is the URL of the frontend
REACT_APP_EMAIL: [email protected] # This is the email of the frontend
container_name: predico_frontend_build
networks:
- predico_network
volumes:
- frontend_build:/app/build # This volume will store the build output
nginx:
container_name: predico_rest_nginx
restart: unless-stopped
build:
context: nginx
dockerfile: Dockerfile
ports:
- "443:443" # HTTPS
environment:
- NGINX_SERVER_NAME=localhost
entrypoint: /bin/bash -c "envsubst '$NGINX_SERVER_NAME' < /etc/nginx/templates/project.conf > /etc/nginx/conf.d/project.conf && nginx -g 'daemon off;'"
depends_on:
- app
- frontend
networks:
- predico_network
volumes:
- frontend_build:/usr/share/nginx/html # Correcting the path for admin frontend
- static_volume:/usr/src/django/api/staticfiles # Serve Django static files correctly
- media_volume:/usr/src/django/api/mediafiles # Serve Django media files
- mkdocs_build:/usr/share/nginx/html/docs # Serve MkDocs build output
- ./nginx:/etc/nginx/templates
mkdocs:
image: squidfunk/mkdocs-material:latest
container_name: predico_mkdocs
volumes:
- ./documentation:/documentation # Mount your MkDocs source directory
- mkdocs_build:/documentation/site
command: build --clean # Build the MkDocs site
working_dir: /documentation # Set the working directory to /docs
networks:
- predico_network
restart: "no"
forecast:
container_name: predico_forecast
build:
context: forecast
env_file:
- forecast/.env
networks:
- predico_network
volumes:
- ./forecast/files/:/app/files/
volumes:
frontend_build:
postgresql-data:
static_volume:
media_volume:
mkdocs_build:
networks:
predico_network:
driver: bridge