mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-07 03:59:48 -06:00
- Move Docker healthcheck from Dockerfile to docker-compose files for better environment-specific configuration - Add silent flag to healthcheck curl commands to reduce log noise - Add error handling for missing link_templates table in client view - Improve offline sync date formatting with ISO 8601 conversion helper - Enhance error handlers and profile edit template This improves robustness when migrations haven't been run and provides better date handling in offline sync scenarios.
57 lines
2.2 KiB
YAML
57 lines
2.2 KiB
YAML
services:
|
|
app:
|
|
build: .
|
|
container_name: timetracker-app-local-test
|
|
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}
|
|
# TROUBLESHOOTING: If forms fail with "CSRF token missing or invalid":
|
|
# 1. For local testing, you can disable CSRF: WTF_CSRF_ENABLED=false
|
|
# 2. Or ensure SECRET_KEY doesn't change: set a fixed value in .env
|
|
# 3. Enable CSRF for production-like testing: WTF_CSRF_ENABLED=true
|
|
# For details: docs/CSRF_CONFIGURATION.md
|
|
- SECRET_KEY=${SECRET_KEY:-local-test-secret-key}
|
|
# Use SQLite database for local testing
|
|
- DATABASE_URL=sqlite:////data/timetracker.db
|
|
- LOG_FILE=/app/logs/timetracker.log
|
|
# CSRF Protection (can be disabled for local testing)
|
|
- WTF_CSRF_ENABLED=${WTF_CSRF_ENABLED:-false}
|
|
- WTF_CSRF_TIME_LIMIT=${WTF_CSRF_TIME_LIMIT:-3600}
|
|
# Disable secure cookies for local testing
|
|
- SESSION_COOKIE_SECURE=false
|
|
- REMEMBER_COOKIE_SECURE=false
|
|
# Set Flask environment for development
|
|
- FLASK_ENV=development
|
|
- FLASK_DEBUG=true
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
# Mount data directory for SQLite database and uploads
|
|
- app_data_local_test:/data
|
|
# Mount uploads directory for logos and avatars
|
|
- app_uploads_local_test:/app/app/static/uploads
|
|
# Mount logs directory for easier debugging
|
|
- ./logs:/app/logs
|
|
restart: unless-stopped
|
|
# Run as root initially to set up permissions, then switch to timetracker user
|
|
user: "0:0"
|
|
# Use custom entrypoint for local testing
|
|
entrypoint: ["/app/docker/entrypoint-local-test.sh"]
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "-s", "-o", "/dev/null", "http://localhost:8080/_health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
volumes:
|
|
app_data_local_test:
|
|
driver: local
|
|
app_uploads_local_test:
|
|
driver: local
|