-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-deploy.yml
114 lines (111 loc) · 4.4 KB
/
docker-compose-deploy.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
103
104
105
106
107
108
109
110
111
112
113
114
services:
db:
image: postgres
environment:
- POSTGRES_DB=${SQL_DATABASE}
- POSTGRES_USER=${SQL_USER}
- POSTGRES_PASSWORD=${SQL_PASSWORD}
- PGHOST=${SQL_HOST}
- PGPORT=${SQL_PORT}
- PGUSER=${SQL_USER}
- PGDATABASE=${SQL_DATABASE}
- PGPASSWORD=${SQL_PASSWORD}
volumes:
- /home/github-runner/podman-volumes/db-data:/var/lib/postgresql/data
- /home/github-runner/podman-volumes/db-backups:/backups
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
start_period: 5s
interval: 5s
timeout: 5s
retries: 5
restart: always
ip2country:
image: extrawurst/ip2country:latest
ports:
- 8854:5000
restart: always
server:
build:
context: ./backend
dockerfile: Dockerfile
depends_on:
db:
condition: service_healthy
ip2country:
condition: service_started
volumes:
- /home/github-runner/podman-volumes/server-static:/server/static
- /home/github-runner/podman-volumes/server-logs:/server/logs
- /home/github-runner/podman-volumes/server-uploads:/server/upload
environment:
- AML_ALLOWED_HOSTS=${AML_ALLOWED_HOSTS}
- CSRF_TRUSTED_ORIGINS=${CSRF_TRUSTED_ORIGINS}
- AML_DEBUG=${AML_DEBUG}
- AML_CORS_ORIGIN_WHITELIST=${AML_CORS_ORIGIN_WHITELIST}
- AML_LOCATION_PROVIDER=${AML_LOCATION_PROVIDER}
- AML_SECRET_KEY=${AML_SECRET_KEY}
- AML_SUBPATH=${AML_SUBPATH}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME}
- DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}
- DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD}
- SENTRY_DSN=${SENTRY_DSN}
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}
- SQL_DATABASE=${SQL_DATABASE}
- SQL_USER=${SQL_USER}
- SQL_PASSWORD=${SQL_PASSWORD}
- SQL_HOST=${SQL_HOST}
ports:
- 8000:8000
command: bash -c "python manage.py migrate && python manage.py bootstrap && python manage.py collectstatic --noinput && gunicorn aml.wsgi:application --bind 0.0.0.0:8000"
restart: always
client-builder:
build:
context: ./frontend
dockerfile: Dockerfile
target: builder
volumes:
- type: bind
source: ./frontend/src
target: /client/src
- type: bind
source: ./frontend/public
target: /client/public
- type: bind
source: ./frontend/.storybook
target: /client/.storybook
environment:
- VITE_API_ROOT=${FRONTEND_API_ROOT}
- VITE_EXPERIMENT_SLUG=${FRONTEND_EXPERIMENT_SLUG}
- VITE_AML_HOME=${FRONTEND_AML_HOME}
- VITE_LOGO_URL=${FRONTEND_LOGO_URL}
- VITE_HTML_FAVICON=${FRONTEND_HTML_FAVICON}
- VITE_HTML_PAGE_TITLE=${FRONTEND_HTML_PAGE_TITLE}
- VITE_HTML_OG_DESCRIPTION=${FRONTEND_HTML_OG_DESCRIPTION}
- VITE_HTML_OG_IMAGE=${FRONTEND_HTML_OG_IMAGE}
- VITE_HTML_OG_TITLE=${FRONTEND_HTML_OG_TITLE}
- VITE_HTML_OG_URL=${FRONTEND_HTML_OG_URL}
- VITE_HTML_BODY_CLASS=${FRONTEND_HTML_BODY_CLASS}
- VITE_SENTRY_DSN=${FRONTEND_SENTRY_DSN}
- VITE_STRICT=${FRONTEND_STRICT}
restart: "no"
# This service is responsible for serving
# 1. The built frontend from the client-builder service
# 2. The static files from the server service (e.g., static files & uploads from the Django app)
nginx-proxy:
build:
context: ./frontend
dockerfile: Dockerfile
target: runner
command: nginx -g 'daemon off;'
ports:
- 8080:80
depends_on:
- client-builder
- server
volumes:
- /home/github-runner/podman-volumes/server-static:/usr/share/nginx/html/django_static
- /home/github-runner/podman-volumes/server-uploads:/usr/share/nginx/html/upload
- ./nginx/custom-nginx.conf:/etc/nginx/conf.d/default.conf
restart: always