---
services:
  backend:
    image: registry.kucharczyk.xyz/timetracker
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - TZ=Europe/Prague
      - CSRF_TRUSTED_ORIGINS="https://tracker.kucharczyk.xyz"
    user: "1000"
    volumes:
      - "static-files:/var/www/django/static"
      - "$PWD/db.sqlite3:/home/timetracker/app/db.sqlite3"
    restart: unless-stopped

  frontend:
    image: caddy
    volumes:
      - "static-files:/usr/share/caddy:ro"
      - "$PWD/Caddyfile:/etc/caddy/Caddyfile"
    ports:
      - "8000:8000"
    depends_on:
      - backend

volumes:
  static-files:
    
    