|
| 1 | +# ===================================================================== |
| 2 | +# Time Tracker — environment configuration |
| 3 | +# Copy this file to .env and edit the values. Never commit .env to git. |
| 4 | +# ===================================================================== |
| 5 | + |
| 6 | +# ---- Django ---------------------------------------------------------- |
| 7 | +# REQUIRED for production. Generate with: |
| 8 | +# python -c 'import secrets; print(secrets.token_urlsafe(64))' |
| 9 | +DJANGO_SECRET_KEY= |
| 10 | + |
| 11 | +# Set to True only for local development. Never True in production. |
| 12 | +DJANGO_DEBUG=False |
| 13 | + |
| 14 | +# Hostnames the app will accept (browser-facing). Comma-separated. |
| 15 | +# Example: timetracker.example.com,localhost |
| 16 | +DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1 |
| 17 | + |
| 18 | +# Trusted origins for CSRF (include scheme). Required when behind a proxy with HTTPS. |
| 19 | +# Example: https://timetracker.example.com |
| 20 | +DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost,http://127.0.0.1 |
| 21 | + |
| 22 | +# ---- Reverse proxy / HTTPS hardening -------------------------------- |
| 23 | +# Set to True only if a reverse proxy you control terminates HTTPS and |
| 24 | +# sets X-Forwarded-Proto. NEVER enable this when the container is reachable |
| 25 | +# directly without a trusted proxy in front. |
| 26 | +DJANGO_BEHIND_HTTPS_PROXY=False |
| 27 | + |
| 28 | +# Enable secure-cookie flags. Only set True when the site is served over HTTPS. |
| 29 | +DJANGO_COOKIE_SECURE=False |
| 30 | + |
| 31 | +# Enable HSTS. Only set True when the site is served over HTTPS and you have |
| 32 | +# verified the certificate chain — HSTS is a one-way street. |
| 33 | +DJANGO_HSTS=False |
| 34 | + |
| 35 | +# ---- PostgreSQL ------------------------------------------------------ |
| 36 | +POSTGRES_DB=timetracker |
| 37 | +POSTGRES_USER=timetracker |
| 38 | +POSTGRES_PASSWORD=please-change-me |
| 39 | +POSTGRES_HOST=db |
| 40 | +POSTGRES_PORT=5432 |
| 41 | + |
| 42 | +# ---- Host port ------------------------------------------------------- |
| 43 | +# Port on the docker host that maps to Apache:80 inside the container. |
| 44 | +WEB_PORT=8080 |
| 45 | + |
| 46 | +# ---- Timezone -------------------------------------------------------- |
| 47 | +TZ=UTC |
| 48 | + |
| 49 | +# ---- One-shot superuser bootstrap (optional, FIRST start only) ------- |
| 50 | +# Recommended workflow: |
| 51 | +# 1) Set the three variables below and DJANGO_AUTO_CREATE_SUPERUSER=true |
| 52 | +# 2) docker compose up -d --build |
| 53 | +# 3) Log in, then set DJANGO_AUTO_CREATE_SUPERUSER=false (or remove the vars) |
| 54 | +# 4) Change your password via the UI (top-right menu → "Change password") |
| 55 | +# |
| 56 | +# Or skip the env vars entirely and run: |
| 57 | +# docker compose exec web python manage.py createsuperuser |
| 58 | +DJANGO_AUTO_CREATE_SUPERUSER=false |
| 59 | +DJANGO_SUPERUSER_USERNAME= |
| 60 | +DJANGO_SUPERUSER_PASSWORD= |
| 61 | +DJANGO_SUPERUSER_EMAIL= |
0 commit comments