forked from NextStopLabs/MyBusTimes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
83 lines (75 loc) · 2.24 KB
/
Copy pathcompose.yaml
File metadata and controls
83 lines (75 loc) · 2.24 KB
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
services:
docker-socket-proxy:
user: "0:0"
privileged: true
image: ghcr.io/wollomatic/socket-proxy:1 # valid version tag
command:
- "-listenip=0.0.0.0"
- "-allowfrom=172.16.0.0/12" # Restrict to docker network CIDR
- "-allowGET=/v1\\..{1,2}/(version|containers/.*|events.*)"
- "-allowHEAD=/_ping"
ports:
- "2375:2375"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- web
traefik:
image: traefik:v3
privileged: true
container_name: traefik
restart: unless-stopped
ports:
- "8001:80"
- "4431:443"
- "8080:8080"
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
command:
- --providers.docker.endpoint=tcp://docker-socket-proxy:2375
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --api.insecure=true
- --log.level=WARN
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web.forwardedHeaders.trustedIPs=172.16.0.0/12
- --entrypoints.websecure.forwardedHeaders.trustedIPs=172.16.0.0/12
networks:
- web
web:
privileged: true
user: "0:0"
image: ghcr.io/nextstoplabs/mybustimes:latest
env_file:
- .env
command: >
gunicorn mybustimes.wsgi:application
--bind 0.0.0.0:8000
--workers 8 --threads 1 --timeout 90 --keep-alive 30 --max-requests 1000 --max-requests-jitter 200
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0) if urllib.request.urlopen('http://127.0.0.1:8000/healthz/').status == 200 else sys.exit(1)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
labels:
- traefik.enable=true
- traefik.http.routers.mbt-web.rule=Host(`www.mybustimes.cc`)
- traefik.http.routers.mbt-web.entrypoints=web
- traefik.http.routers.mbt-web.service=mbt-web-service
- traefik.http.services.mbt-web-service.loadbalancer.server.port=8000
networks:
- web
networks:
web:
external: true