repos
/ timestrap-django master

timestrap-django

mirror archived upstream

Time tracking you can host anywhere, built on Django. Full export support in multiple formats and easily extensible.

djangodockerhandcodedpythonself-hostedtime-trackingtimetracker

1.4 KB · 53 lines · YAML Raw History
 1# Example docker-compose.yml exposing timestrap via Traefik v2.1
 2
 3version: "3"
 4
 5services:
 6  timestrap:
 7    container_name: timestrap
 8    image: my-timestrap-image:latest
 9    command: daphne timestrap.asgi:application --port 8899 --bind 0.0.0.0 -v2
10    labels:
11      traefik.enable: "true"
12      traefik.http.routers.timestrap.rule: "Host(`timestrap.my.domain`)"
13      traefik.http.routers.timestrap.entrypoints: "https"
14      traefik.http.routers.timestrap.tls.certresolver: "letsencrypt"
15      traefik.http.services.timestrap.loadbalancer.server.port: "8899"
16      traefik.docker.network: "web"
17    depends_on:
18      - db
19      - redis
20    environment:
21      - DJANGO_SETTINGS_MODULE=timestrap.settings.docker
22      - SECRET_KEY=super-secret-key
23      - POSTGRES_DB=timestrap
24      - POSTGRES_USER=timestrap
25      - POSTGRES_PASSWORD=timestrap
26    networks:
27      - timestrap_network
28      - web
29
30  db:
31    image: postgres
32    container_name: timestrap_postgres
33    environment:
34      - POSTGRES_DB=timestrap
35      - POSTGRES_USER=timestrap
36      - POSTGRES_PASSWORD=timestrap
37      - PGDATA=/db-data
38    volumes:
39      - ./data:/db-data # mount a local directory as the Postgres Data directory (relative path)
40    networks:
41      - timestrap_network
42
43  redis:
44    image: redis
45    container_name: timestrap_redis
46    networks:
47      - timestrap_network
48
49networks:
50  timestrap_network:
51    external: false
52  web:
53    external: true