Skip to content

Commit 8df1b86

Browse files
authored
Merge pull request #1 from maarteNNNN/copilot/fix-5fb1f0a8-c680-4a23-8bc1-ca4803b3e3fa
Add WGER fitness template for Dokploy deployment
2 parents 3f75e7b + ccdff55 commit 8df1b86

File tree

4 files changed

+261
-0
lines changed

4 files changed

+261
-0
lines changed

blueprints/wger/docker-compose.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
services:
2+
web:
3+
image: wger/server:latest
4+
depends_on:
5+
db:
6+
condition: service_healthy
7+
cache:
8+
condition: service_healthy
9+
env_file:
10+
- ./config/prod.env
11+
volumes:
12+
- static:/home/wger/static
13+
- media:/home/wger/media
14+
expose:
15+
- 8000
16+
healthcheck:
17+
test: wget --no-verbose --tries=1 --spider http://localhost:8000
18+
interval: 10s
19+
timeout: 5s
20+
start_period: 300s
21+
retries: 5
22+
restart: unless-stopped
23+
24+
nginx:
25+
image: nginx:stable
26+
depends_on:
27+
- web
28+
volumes:
29+
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
30+
- static:/wger/static:ro
31+
- media:/wger/media:ro
32+
expose:
33+
- 80
34+
healthcheck:
35+
test: service nginx status
36+
interval: 10s
37+
timeout: 5s
38+
retries: 5
39+
start_period: 30s
40+
restart: unless-stopped
41+
42+
db:
43+
image: postgres:15-alpine
44+
environment:
45+
- POSTGRES_USER=${POSTGRES_USER}
46+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
47+
- POSTGRES_DB=${POSTGRES_DB}
48+
- TZ=${TIMEZONE}
49+
volumes:
50+
- postgres-data:/var/lib/postgresql/data/
51+
expose:
52+
- 5432
53+
healthcheck:
54+
test: pg_isready -U ${POSTGRES_USER}
55+
interval: 10s
56+
timeout: 5s
57+
retries: 5
58+
start_period: 30s
59+
restart: unless-stopped
60+
61+
cache:
62+
image: redis
63+
expose:
64+
- 6379
65+
volumes:
66+
- ./config/redis.conf:/usr/local/etc/redis/redis.conf
67+
- redis-data:/data
68+
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
69+
healthcheck:
70+
test: redis-cli ping
71+
interval: 10s
72+
timeout: 5s
73+
retries: 5
74+
start_period: 30s
75+
restart: unless-stopped
76+
77+
celery_worker:
78+
image: wger/server:latest
79+
command: /start-worker
80+
env_file:
81+
- ./config/prod.env
82+
volumes:
83+
- media:/home/wger/media
84+
depends_on:
85+
web:
86+
condition: service_healthy
87+
healthcheck:
88+
test: celery -A wger inspect ping
89+
interval: 10s
90+
timeout: 5s
91+
retries: 5
92+
start_period: 30s
93+
94+
celery_beat:
95+
image: wger/server:latest
96+
command: /start-beat
97+
volumes:
98+
- celery-beat:/home/wger/beat/
99+
env_file:
100+
- ./config/prod.env
101+
depends_on:
102+
celery_worker:
103+
condition: service_healthy
104+
105+
volumes:
106+
postgres-data:
107+
celery-beat:
108+
redis-data:
109+
media:
110+
static:

blueprints/wger/template.toml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
[variables]
2+
main_domain = "${domain}"
3+
postgres_user = "wger"
4+
postgres_password = "${password:32}"
5+
postgres_db = "wger"
6+
timezone = "Europe/Berlin"
7+
django_secret_key = "${password:64}"
8+
redis_password = "${password:32}"
9+
10+
[config]
11+
[[config.domains]]
12+
serviceName = "nginx"
13+
port = 80
14+
host = "${main_domain}"
15+
16+
[config.env]
17+
POSTGRES_USER = "${postgres_user}"
18+
POSTGRES_PASSWORD = "${postgres_password}"
19+
POSTGRES_DB = "${postgres_db}"
20+
TIMEZONE = "${timezone}"
21+
22+
[[config.mounts]]
23+
filePath = "config/prod.env"
24+
content = """
25+
# Django configuration
26+
DEBUG=False
27+
SECRET_KEY=${django_secret_key}
28+
ALLOWED_HOSTS=${main_domain},localhost,127.0.0.1
29+
CSRF_TRUSTED_ORIGINS=https://${main_domain},http://${main_domain}
30+
31+
# Database configuration
32+
DATABASE_URL=postgresql://${postgres_user}:${postgres_password}@db:5432/${postgres_db}
33+
34+
# Cache configuration
35+
CACHE_URL=redis://cache:6379/1
36+
37+
# Celery configuration
38+
CELERY_BROKER_URL=redis://cache:6379/2
39+
CELERY_RESULT_BACKEND=redis://cache:6379/3
40+
41+
# Email configuration (optional - configure for password reset functionality)
42+
# EMAIL_HOST=
43+
# EMAIL_PORT=587
44+
# EMAIL_HOST_USER=
45+
# EMAIL_HOST_PASSWORD=
46+
# EMAIL_USE_TLS=True
47+
# FROM_EMAIL=noreply@${main_domain}
48+
49+
# Media and static files
50+
MEDIA_URL=/media/
51+
STATIC_URL=/static/
52+
53+
# Application settings
54+
TIME_ZONE=${timezone}
55+
LANGUAGE_CODE=en-us
56+
USE_TZ=True
57+
58+
# Security settings
59+
SECURE_SSL_REDIRECT=False
60+
SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https
61+
"""
62+
63+
[[config.mounts]]
64+
filePath = "config/nginx.conf"
65+
content = """
66+
upstream wger {
67+
server web:8000;
68+
}
69+
70+
server {
71+
listen 80;
72+
server_name ${main_domain};
73+
client_max_body_size 50M;
74+
75+
location / {
76+
proxy_pass http://wger;
77+
proxy_set_header Host $host;
78+
proxy_set_header X-Real-IP $remote_addr;
79+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
80+
proxy_set_header X-Forwarded-Proto $scheme;
81+
proxy_redirect off;
82+
}
83+
84+
location /static/ {
85+
alias /wger/static/;
86+
expires 30d;
87+
add_header Cache-Control "public, immutable";
88+
}
89+
90+
location /media/ {
91+
alias /wger/media/;
92+
expires 7d;
93+
add_header Cache-Control "public";
94+
}
95+
96+
# Security headers
97+
add_header X-Frame-Options "SAMEORIGIN" always;
98+
add_header X-Content-Type-Options "nosniff" always;
99+
add_header X-XSS-Protection "1; mode=block" always;
100+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
101+
}
102+
"""
103+
104+
[[config.mounts]]
105+
filePath = "config/redis.conf"
106+
content = """
107+
# Redis configuration for WGER
108+
bind 0.0.0.0
109+
port 6379
110+
timeout 0
111+
tcp-keepalive 300
112+
113+
# Memory and persistence
114+
save 900 1
115+
save 300 10
116+
save 60 10000
117+
stop-writes-on-bgsave-error yes
118+
rdbcompression yes
119+
rdbchecksum yes
120+
dbfilename dump.rdb
121+
dir /data
122+
123+
# Logging
124+
loglevel notice
125+
logfile ""
126+
127+
# Security
128+
protected-mode no
129+
130+
# Memory management
131+
maxmemory-policy allkeys-lru
132+
"""

blueprints/wger/wger.png

8.29 KB
Loading

meta.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4718,6 +4718,25 @@
47184718
"networking"
47194719
]
47204720
},
4721+
{
4722+
"id": "wger",
4723+
"name": "WGER",
4724+
"version": "latest",
4725+
"description": "WGER is a free, open-source web application that manages your exercises, workouts and nutrition. Track your progress, create custom workouts, and manage your fitness journey.",
4726+
"logo": "wger.png",
4727+
"links": {
4728+
"github": "https://github.com/wger-project/wger",
4729+
"website": "https://wger.de/",
4730+
"docs": "https://wger.readthedocs.io/"
4731+
},
4732+
"tags": [
4733+
"fitness",
4734+
"health",
4735+
"workout",
4736+
"exercise",
4737+
"nutrition"
4738+
]
4739+
},
47214740
{
47224741
"id": "wikijs",
47234742
"name": "Wiki.js",

0 commit comments

Comments
 (0)