version: "3.7" networks: net: volumes: pgdata: x-op-service-default: &service_default restart: always # unless-stopped init: true services: ntpd: <<: *service_default build: context: ./ntpd image: daniviga/ntpd networks: - net ports: - "123:123/udp" timescale: <<: *service_default image: timescale/timescaledb:latest-pg12 environment: POSTGRES_USER: "bite" POSTGRES_PASSWORD: "password" volumes: - "pgdata:/var/lib/postgresql/data" networks: - net broker: <<: *service_default image: eclipse-mosquitto networks: - net ports: - "1883:1883" ingress: <<: *service_default image: traefik:v2.2 command: --api.insecure=true --providers.docker ports: - "8000:80" - "8080:8080" networks: - net volumes: # So that Traefik can listen to the Docker events - /var/run/docker.sock:/var/run/docker.sock bite: <<: *service_default build: context: .. dockerfile: ./docker/django/Dockerfile image: daniviga/bite volumes: - "../bite:/srv/app/bite" command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"] networks: - net depends_on: - ingress - data-migration - timescale labels: - "traefik.http.routers.bite.rule=PathPrefix(`/`)" data-migration: image: daniviga/bite volumes: - "../bite:/srv/app/bite" command: ["dockerize", "-wait", "tcp://timescale:5432", "python3", "manage.py", "migrate", "--noinput"] networks: - net depends_on: - timescale mqtt-to-db: <<: *service_default image: daniviga/bite volumes: - "../bite:/srv/app/bite" command: ["python3", "manage.py", "mqtt-to-db"] networks: - net depends_on: - data-migration - timescale - broker