Files
TimeTracker/docker-compose.local-test.yml
Dries Peeters 7486037307 feat: local SQLite test env, UI fixes, and DB migrations
- UI/UX: Refine layouts and responsive styles; fix task and timer views; update
  shared components and dashboard templates
  - Updates across `app/templates/**`, `templates/**`, `app/static/base.css`,
    and `app/static/mobile.css`
- Backend: Route cleanups and minor fixes for admin, auth, invoices, and timer
  - Touches `app/routes/admin.py`, `app/routes/auth.py`, `app/routes/api.py`,
    `app/routes/invoices.py`, `app/routes/timer.py`
- DevOps: Improve Docker setup and add local testing workflow
  - Update `Dockerfile`, `docker/start-fixed.py`
  - Add `docker-compose.local-test.yml`, `.env.local-test`, start scripts
- Docs: Update `README.md` and add `docs/LOCAL_TESTING_WITH_SQLITE.md`
- Utilities: Adjust CLI and PDF generator behavior

Database (Alembic) migrations:
- 005_add_missing_columns.py
- 006_add_logo_and_task_timestamps.py
- 007_add_invoice_and_more_settings_columns.py
- 008_align_invoices_and_settings_more.py
- 009_add_invoice_created_by.py
- 010_enforce_single_active_timer.py

BREAKING CHANGE: Only one active timer per user is now enforced.

Note: Apply database migrations after deploy (e.g., `alembic upgrade head`).
2025-09-10 11:49:49 +02:00

47 lines
1.6 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}
- 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
# 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
# Disable license server for local testing
- LICENSE_SERVER_ENABLED=false
ports:
- "8080:8080"
volumes:
# Mount data directory for SQLite database and uploads
- app_data_local_test:/data
# 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", "http://localhost:8080/_health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
volumes:
app_data_local_test:
driver: local