-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
145 lines (128 loc) · 2.94 KB
/
docker-compose.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
volumes:
pgdata: {}
statics: {}
x-django-env: &django-env
DATABASE_URL: "postgis://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=disable"
DJANGO_SETTINGS_MODULE: config.settings.production
USE_DOCKER: "yes"
OIDC_PROVIDER_ID: nina
OIDC_CLIENT_ID: "${OIDC_CLIENT_ID}"
OIDC_SECRET: "${OIDC_SECRET}"
OIDC_PROVIDER_URL: "${OIDC_PROVIDER_URL}"
OIDC_PROVIDER_NAME: NINA
x-django-prod-env: &django-prod-env
<<: *django-env
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY}"
DJANGO_SERVER_EMAIL: ""
DJANGO_ADMIN_URL: admin/
DJANGO_SECURE_SSL_REDIRECT: False
WEB_CONCURRENCY: 4
DJANGO_ALLOWED_HOSTS: "localhost,django"
x-django-dev-env: &django-dev-env
<<: *django-env
DJANGO_SETTINGS_MODULE: config.settings.local
IPYTHONDIR: "/app/.ipython"
x-django: &django
build:
target: django
depends_on:
- postgres
environment:
<<: *django-env
x-django-prod: &django-prod
<<: *django
depends_on:
- postgres
profiles:
- prod
command: gunicorn config.wsgi --bind 0.0.0.0:8000 --chdir=/app
x-django-dev: &django-dev
<<: *django
build:
target: dev
profiles:
- dev
environment:
<<: *django-dev-env
volumes:
- ./src:/app/src
- ./media:/app/media
- /tmp/.X11-unix:/tmp/.X11-unix:ro
command: manage.py runserver 0.0.0.0:8000
#command: python -m pdb -c continue manage.py runserver 0.0.0.0:8000 --nothreading --noreload
services:
django:
<<: *django-prod
environment:
<<: *django-prod-env
DJANGO_COLLECTSTATIC: 1
DJANGO_MIGRATE: 1
volumes:
- statics:/app/staticfiles
django-dev:
<<: *django-dev
tty: true
stdin_open: true
hostname: django
environment:
<<: *django-dev-env
DJANGO_MIGRATE: 1
LIVE_SERVER_URL: http://django:8000
DISPLAY: ${DISPLAY}
queue:
<<: *django-prod
environment:
<<: *django-prod-env
WAIT_FOR_HTTP: http://django:8000/ht/
command: manage.py procrastinate worker
queue-dev:
<<: *django-dev
environment:
<<: *django-dev-env
WAIT_FOR_HTTP: http://django:8000/ht/
command: manage.py procrastinate worker
tailwind:
<<: *django-dev
tty: true
stdin_open: true
command: manage.py tailwind start
environment:
<<: *django-dev-env
DJANGO_TAILWIND: 1
postgres:
image: postgres:16
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
nginx:
build:
context: ./nginx
profiles:
- prod
volumes:
- statics:/statics
ports:
- 8000:80
nginx-dev:
hostname: nginx
profiles:
- dev
build:
context: ./nginx
volumes:
- ./media:/media_files
ports:
- 8000:80
frontend:
profiles:
- dev
build:
target: frontend
command: npm run dev -- --host 0.0.0.0 --cors
ports:
- 5173:5173
volumes:
- ./src/frontend/src:/app/src