-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (118 loc) · 3.82 KB
/
docker-compose.yml
File metadata and controls
126 lines (118 loc) · 3.82 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
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
version: '3.8'
services:
web:
build: .
container_name: ratemypdf_web
restart: unless-stopped
depends_on:
- redis
volumes:
- pdf-files:/pdf-files
environment:
- DOMAIN=${DOMAIN:-localhost}
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)"
- "traefik.http.routers.web.entrypoints=web"
- "traefik.http.routers.web.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
- "traefik.http.routers.websecure.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)"
- "traefik.http.routers.websecure.entrypoints=websecure"
- "traefik.http.routers.websecure.tls.certresolver=myresolver"
- "traefik.http.routers.api.rule=Host(`monitor.${DOMAIN}`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=myresolver"
- "traefik.http.routers.api.service=api@internal"
- "autoheal=true"
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost/healthz', timeout=2).getcode()==200 else 1)\" "]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
redis:
image: redis:alpine
container_name: ratemypdf_redis
restart: unless-stopped
labels:
- "autoheal=true"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
worker:
build: .
container_name: ratemypdf_worker
restart: unless-stopped
command: rq worker
depends_on:
- redis
volumes:
- pdf-files:/pdf-files
env_file:
- .env
environment:
- REDIS_URL=redis://redis:6379/0
labels:
- "autoheal=true"
healthcheck:
test: ["CMD-SHELL", "python -c \"import os,sys,redis; r=redis.from_url(os.getenv('REDIS_URL','redis://redis:6379/0')); sys.exit(0 if r.ping() else 1)\" "]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
gotenberg:
image: gotenberg/gotenberg:7
container_name: ratemypdf_gotenberg
restart: unless-stopped
labels:
- "autoheal=true"
ports:
- "3000:3000"
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:3000/health > /dev/null 2>&1 || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
traefik:
image: traefik:v2.5
container_name: ratemypdf_traefik
restart: unless-stopped
labels:
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
command:
- "--api.insecure=true"
- "--ping=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myresolver.acme.email=suffolklitlab@gmail.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./letsencrypt:/letsencrypt"
environment:
- DOMAIN=${DOMAIN:-localhost}
autoheal:
image: willfarrell/autoheal
container_name: ratemypdf_autoheal
restart: unless-stopped
environment:
- AUTOHEAL_INTERVAL=5
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes:
pdf-files: