-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
158 lines (148 loc) · 3.76 KB
/
docker-compose.yml
File metadata and controls
158 lines (148 loc) · 3.76 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
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
#
# Please consult the `Deployment` section in the docs if you want to deploy
# this. You *need* to keep this nginx service, even if you have your own,
# otherwise the static files will not be served correctly! If you do remove
# it, configure yours similarly to what's in config/nginx.conf
# Also take a look at the "Static files" section in the .env file
services:
web:
image: docker.io/wger/server:latest
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- ./config/prod.env
volumes:
- static:/home/wger/static
- media:/home/wger/media
expose:
- 8000
logging:
driver: json-file
options:
max-size: 5m
max-file: 5
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8000"]
interval: 10s
timeout: 5s
start_period: 300s
retries: 5
restart: unless-stopped
nginx:
image: docker.io/nginx:stable
depends_on:
- web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- static:/wger/static:ro
- media:/wger/media:ro
ports:
- "80:80"
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
db:
image: docker.io/postgres:15-alpine
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
- TZ=Europe/Berlin
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
logging:
driver: json-file
options:
max-size: 5m
max-file: 5
healthcheck:
test: ["CMD", "pg_isready", "-U", "wger" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
cache:
image: docker.io/redis
expose:
- 6379
logging:
driver: json-file
options:
max-size: 5m
max-file: 5
volumes:
- ./config/redis.conf:/usr/local/etc/redis/redis.conf
- redis-data:/data
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
# You probably want to limit the memory usage of the cache, otherwise it might
# hog all the available memory. Remove or change according to your needs.
#mem_limit: 5gb
celery_worker:
image: docker.io/wger/server:latest
command: /start-worker
env_file:
- ./config/prod.env
volumes:
- media:/home/wger/media
logging:
driver: json-file
options:
max-size: 5m
max-file: 5
depends_on:
web:
condition: service_healthy
healthcheck:
test: ["CMD", "celery", "-A", "wger", "inspect", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
celery_beat:
image: docker.io/wger/server:latest
command: /start-beat
logging:
driver: json-file
options:
max-size: 5m
max-file: 5
volumes:
- celery-beat:/home/wger/beat/
env_file:
- ./config/prod.env
depends_on:
celery_worker:
condition: service_healthy
restart: unless-stopped
volumes:
postgres-data:
celery-beat:
redis-data:
# Heads up, if you remove these volumes and use folders directly you need to chown them
# to the UID and GID 1000 even if it doesn't exist on your system. Also, they should
# be readable by everyone.
#
# https://wger.readthedocs.io/en/latest/production/docker.html#missing-static-files
media:
static:
networks:
default:
name: wger_network