forked from fablabs-ch/fablabsch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (57 loc) · 2.43 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
version: "3"
volumes:
postgres_data: {}
services:
db:
image: postgres:11
volumes:
- postgres_data:/var/lib/postgresql/data
env_file: .env
restart: always
backend:
build: ./backend
env_file: .env
restart: always
#command: bash -c "python manage.py collectstatic --noinput;python manage.py migrate;while true; do sleep 3; python manage.py runserver 0.0.0.0:8000; done"
command: bash -c "python manage.py collectstatic --noinput;python manage.py migrate;while true; do sleep 3; /usr/local/bin/gunicorn fablabsch.wsgi --bind 0.0.0.0:8000 --chdir=/app; done"
#command: bash -c "/usr/local/bin/gunicorn fablabsch.wsgi --bind 0.0.0.0:8000 --chdir=/app"
volumes:
- ./backend:/app
- ./content:/app/content
depends_on:
- db
frontend:
#build:
# context: .
# dockerfile: ./frontend/Dockerfile
image: ghcr.io/fablabs-ch/fablabsch-frontend:latest
restart: always
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./backend/static:/app/static
- ./backend/media:/app/media
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
- "traefik.http.services.fablab.loadbalancer.server.port=80"
- "traefik.http.routers.fablab.rule=Host(`fablab.ch`) || Host(`www.fablab.ch`) || Host(`fablabs.ch`) || Host(`www.fablabs.ch`)"
- "traefik.http.routers.fablab.entrypoints=web"
- "traefik.http.routers.fablab.middlewares=https_redirect"
- "traefik.http.routers.fablab_secured.rule=Host(`fablab.ch`) || Host(`www.fablab.ch`) || Host(`fablabs.ch`) || Host(`www.fablabs.ch`)"
- "traefik.http.routers.fablab_secured.entrypoints=websecure"
- "traefik.http.middlewares.fablab-www-redirect.redirectregex.regex=^https://(?:www\\.)?fablabs?\\.ch(.*)"
- "traefik.http.middlewares.fablab-www-redirect.redirectregex.replacement=https://fablab.ch$${1}"
- "traefik.http.middlewares.fablab-www-redirect.redirectregex.permanent=true"
- "traefik.http.routers.fablab_secured.middlewares=fablab-www-redirect"
- "traefik.http.routers.fablab_secured.tls=true"
- "traefik.http.routers.fablab_secured.tls.certresolver=myresolver"
depends_on:
- backend
networks:
- web
- default
networks:
web:
external: true