mirror of
https://github.com/daniviga/bite.git
synced 2024-11-22 21:16:12 +01:00
145 lines
3.5 KiB
YAML
145 lines
3.5 KiB
YAML
# -*- coding: utf-8 -*-
|
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
|
#
|
|
# BITE - A Basic/IoT/Example
|
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
|
#
|
|
# BITE is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# BITE is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
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-pg15
|
|
environment:
|
|
POSTGRES_USER: "bite"
|
|
POSTGRES_PASSWORD: "password"
|
|
volumes:
|
|
- "pgdata:/var/lib/postgresql/data"
|
|
networks:
|
|
- net
|
|
|
|
broker:
|
|
<<: *service_default
|
|
image: eclipse-mosquitto:1.6
|
|
volumes:
|
|
- "./mqtt/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf"
|
|
networks:
|
|
- net
|
|
|
|
zookeeper:
|
|
image: confluentinc/cp-zookeeper:latest
|
|
networks:
|
|
- net
|
|
environment:
|
|
ZOOKEEPER_CLIENT_PORT: 2181
|
|
ZOOKEEPER_TICK_TIME: 2000
|
|
|
|
kafka:
|
|
image: confluentinc/cp-kafka:latest
|
|
depends_on:
|
|
- zookeeper
|
|
networks:
|
|
- net
|
|
environment:
|
|
KAFKA_BROKER_ID: 1
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
|
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
|
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
|
|
ingress:
|
|
<<: *service_default
|
|
image: nginx:stable-alpine
|
|
environment:
|
|
NGINX_ENTRYPOINT_QUIET_LOGS: 1
|
|
ports:
|
|
- "${CUSTOM_DOCKER_IP:-0.0.0.0}:80:80"
|
|
- "${CUSTOM_DOCKER_IP:-0.0.0.0}:1883:1883"
|
|
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"]
|
|
|
|
dispatcher:
|
|
<<: *service_default
|
|
image: daniviga/bite
|
|
command: ["python3", "manage.py", "dispatcher"]
|
|
networks:
|
|
- net
|
|
depends_on:
|
|
- broker
|
|
|
|
handler:
|
|
<<: *service_default
|
|
image: daniviga/bite
|
|
command: ["python3", "manage.py", "handler"]
|
|
networks:
|
|
- net
|
|
depends_on:
|
|
- data-migration
|
|
- timescale
|