forked from DRYTRIX/TimeTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.nas.yml
More file actions
88 lines (85 loc) Β· 3.11 KB
/
Copy pathdocker-compose.nas.yml
File metadata and controls
88 lines (85 loc) Β· 3.11 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
# TimeTracker β NAS-friendly Docker Compose stack
#
# Designed for QNAP Container Station, Synology Container Manager, Portainer,
# and other NAS UIs where you paste YAML directly (no git clone required).
#
# Quick install:
# 1. Paste this entire file into your NAS stack / project editor.
# 2. Set SECRET_KEY (required). Generate one with: openssl rand -hex 32
# 3. Deploy the stack, then open http://<your-nas-ip>:8080
#
# Full guide: docs/admin/deployment/NAS_DEPLOYMENT.md
services:
app:
image: ghcr.io/drytrix/timetracker:latest
container_name: timetracker-app
environment:
- TZ=${TZ:-Europe/Brussels}
- CURRENCY=${CURRENCY:-EUR}
- ROUNDING_MINUTES=${ROUNDING_MINUTES:-1}
- SINGLE_ACTIVE_TIMER=${SINGLE_ACTIVE_TIMER:-true}
- ALLOW_SELF_REGISTER=${ALLOW_SELF_REGISTER:-true}
- IDLE_TIMEOUT_MINUTES=${IDLE_TIMEOUT_MINUTES:-30}
- ADMIN_USERNAMES=${ADMIN_USERNAMES:-admin}
# Required β generate with: openssl rand -hex 32
- SECRET_KEY=${SECRET_KEY:?Generate one with openssl rand -hex 32}
# Database (bundled Postgres)
- DATABASE_URL=postgresql+psycopg2://timetracker:timetracker@db:5432/timetracker
- LOG_FILE=/app/logs/timetracker.log
# CSRF & cookies (HTTP-safe defaults for LAN access via NAS IP)
- WTF_CSRF_ENABLED=${WTF_CSRF_ENABLED:-true}
- WTF_CSRF_TIME_LIMIT=${WTF_CSRF_TIME_LIMIT:-3600}
- WTF_CSRF_SSL_STRICT=${WTF_CSRF_SSL_STRICT:-false}
- SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-false}
- REMEMBER_COOKIE_SECURE=${REMEMBER_COOKIE_SECURE:-false}
- CSRF_COOKIE_SECURE=${CSRF_COOKIE_SECURE:-false}
- CSRF_COOKIE_HTTPONLY=${CSRF_COOKIE_HTTPONLY:-false}
- CSRF_COOKIE_SAMESITE=${CSRF_COOKIE_SAMESITE:-Lax}
- CSRF_COOKIE_NAME=${CSRF_COOKIE_NAME:-XSRF-TOKEN}
- SESSION_COOKIE_SAMESITE=${SESSION_COOKIE_SAMESITE:-Lax}
- PREFERRED_URL_SCHEME=${PREFERRED_URL_SCHEME:-http}
# Optional features (off by default)
- AI_ENABLED=${AI_ENABLED:-false}
- ENABLE_TELEMETRY=${ENABLE_TELEMETRY:-false}
ports:
- "${HTTP_PORT:-8080}:8080"
volumes:
- app_data:/data
- app_uploads:/app/app/static/uploads
- app_logs:/app/logs
depends_on:
db:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "-s", "-o", "/dev/null", "http://localhost:8080/_health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:16-alpine
container_name: timetracker-db
environment:
- POSTGRES_DB=${POSTGRES_DB:-timetracker}
- POSTGRES_USER=${POSTGRES_USER:-timetracker}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-timetracker}
- TZ=${TZ:-Europe/Brussels}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
app_data:
driver: local
app_uploads:
driver: local
app_logs:
driver: local
db_data:
driver: local