-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
171 lines (154 loc) · 4.9 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
services:
django:
build:
context: ./BackendAPI
target: server
pull: true
pull_policy: build
volumes:
- django_media:/app/media:rw
command: daphne config.asgi:application -b 0.0.0.0
depends_on:
- database
profiles:
- prod
env_file:
- .env
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
DJANGO_DEBUG: False
labels:
- traefik.enable=true
- traefik.http.routers.registration-backend.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`) && PathRegexp(`^/(api|admin|registration)`)
- traefik.http.services.registration-backend.loadbalancer.server.port=8000
#- traefik.http.routers.registration-backend.entrypoints=web,websecure
django-staticfiles:
build:
context: ./BackendAPI
target: static-server
pull: true
pull_policy: build
volumes:
- django_media:/srv/http/media:ro
profiles:
- prod
env_file:
- .env
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
SERVER_LOG_LEVEL: warn
labels:
- traefik.enable=true
- traefik.http.routers.registration-backend-staticfiles.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`) && PathRegexp(`^/(static)`)
- traefik.http.services.registration-backend-staticfiles.loadbalancer.server.port=80
#- traefik.http.routers.registration-backend-staticfiles.entrypoints=web,websecure
django-dev:
build:
context: ./BackendAPI
target: dev
pull: true
pull_policy: build
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./BackendAPI:/app:rw
ports:
- "8000:8000"
env_file:
- .env
depends_on:
- database
profiles:
- dev
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
DJANGO_DEBUG: True
labels:
- traefik.enable=true
- traefik.http.routers.registration-backend.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`) && PathRegexp(`^/(api|admin|static|registration)`)
#- traefik.http.routers.registration-backend.entrypoints=web,websecure
database:
image: postgres:17
env_file:
- .env
shm_size: 256MB
volumes:
- postgres_data:/var/lib/postgresql/data/
profiles:
- prod
- dev
nextjs:
build:
context: ./Registrering/registration-frontend-react/
target: static-server
pull: true
pull_policy: build
profiles:
- prod
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
labels:
- traefik.enable=true
- traefik.http.routers.registration-frontend.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`)
- traefik.http.services.registration-frontend.loadbalancer.server.port=80
#- traefik.http.routers.registration-frontend.entrypoints=web,websecure
nextjs-dev:
build:
context: ./Registrering/registration-frontend-react/
target: dev-server
pull: true
pull_policy: build
volumes:
- ./Registrering/registration-frontend-react:/app:rw
ports:
- 3000:3000/tcp
profiles:
- dev
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
labels:
- traefik.enable=true
- traefik.http.routers.registration-frontend.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`)
#- traefik.http.routers.registration-frontend.entrypoints=web,websecure
nextjs-info-dev:
build:
context: ./Crewgrensesnitt/frontend/
target: dev-server
pull: true
pull_policy: build
volumes:
- ./Crewgrensesnitt/frontend:/app:rw
ports:
- 3001:3000/tcp
profiles:
- dev
environment:
REGISTRATION_HOSTNAME: ${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}
DJANGO_DEBUG: True
labels:
- traefik.enable=true
- traefik.http.routers.info-frontend.rule=Host(`${REGISTRATION_HOSTNAME:-registration.eventaccess.localhost}`) && PathRegexp(`^/(info)`)
#- traefik.http.routers.info-frontend.entrypoints=web,websecure
reverse-proxy:
image: traefik:v3.3.4
pull_policy: always
command:
- --api.insecure=true
- --providers.docker
- --entryPoints.web.address=:80
#- --entryPoints.websecure.address=:443
- --providers.docker.exposedbydefault=false
ports:
- 80:80/tcp
# TODO: Add https configuration
#- 443:443/tcp
# The Web UI (enabled by --api.insecure=true)
- 8080:8080
profiles:
- dev
- prod
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
postgres_data:
django_media: