1
0
mirror of https://github.com/daniviga/bite.git synced 2024-11-23 05:16:13 +01:00
bite/docker/docker-compose.yml
Daniele Viganò be4c226955
Fix HTTP reverse proxy with embedded IoT (#20)
* Add an ENV far for custom docker binding

* Delay in Arduino can be customized

* Fix 400 error with Arduino telemetry and Nginx
This was caused by the client not waiting for a response.
Also Content-Length header was bogus.

* Do not crash mqtt-to-db if devices isn't proviosioned

* Update READMEs
2020-06-21 22:58:46 +02:00

96 lines
1.9 KiB
YAML

version: "3.7"
networks:
net:
volumes:
pgdata:
staticdata:
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:
- "${CUSTOM_DOCKER_IP:-0.0.0.0}: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
volumes:
- "./mqtt/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf"
networks:
- net
ports:
- "${CUSTOM_DOCKER_IP:-0.0.0.0}:1883:1883"
ingress:
<<: *service_default
image: nginx:stable-alpine
ports:
- "${CUSTOM_DOCKER_IP:-0.0.0.0}:80:80"
networks:
- net
volumes:
- staticdata:/srv/appdata/bite/static
- ./ingress/nginx.conf:/etc/nginx/nginx.conf
bite:
<<: *service_default
build:
context: ..
dockerfile: ./docker/django/Dockerfile
image: daniviga/bite
command: ["gunicorn", "-b", "0.0.0.0:8000", "bite.wsgi:application"]
networks:
- net
depends_on:
- ingress
- data-migration
- timescale
data-migration:
image: daniviga/bite
command: ["dockerize", "-wait", "tcp://timescale:5432", "python3", "manage.py", "migrate", "--noinput"]
networks:
- net
depends_on:
- timescale
static-files:
image: daniviga/bite
volumes:
- staticdata:/srv/appdata/bite/static
command: ["python3", "manage.py", "collectstatic", "--noinput"]
mqtt-to-db:
<<: *service_default
image: daniviga/bite
command: ["python3", "manage.py", "mqtt-to-db"]
networks:
- net
depends_on:
- data-migration
- timescale
- broker