deploy/compose.base.yml
# base configuration docker-compose file
version: '3.7'
services:
proxy:
image: 'nginx:1.15.12-alpine'
container_name: 'proxy'
volumes:
- "./logs/nginx_proxy:/var/log/nginx"
ports:
- "80:80"
depends_on:
- api_server
- frontend
restart: unless-stopped
api:
image: 'unbrake/api:latest'
depends_on:
- db
restart: unless-stopped
secrets:
- api-django-secret-key
- postgres_password
- mqtt-reading-key
- mqtt-writing-key
frontend:
image: 'unbrake/frontend:latest'
volumes:
- "./logs/nginx_frontend:/var/log/nginx"
restart: unless-stopped
db:
image: 'postgres:11.2-alpine'
container_name: 'api-database'
environment:
POSTGRES_PASSWORD_FILE: '/run/secrets/postgres_password'
POSTGRES_DB: 'unbrake'
POSTGRES_USER: 'unbrake'
TZ: 'America/Sao_Paulo'
PGTZ: 'America/Sao_Paulo'
volumes:
- postgres_data:/var/lib/postgresql/data/
secrets:
- postgres_password
restart: unless-stopped
api_server:
image: 'nginx:1.15.12-alpine'
container_name: 'api-server'
volumes:
- "./logs/nginx_api:/var/log/nginx"
depends_on:
- api
restart: unless-stopped
mqtt:
container_name: 'mqtt'
image: 'emitter/server'
ports:
- "8080:8080"
env_file:
- .env_mqtt
restart: unless-stopped
secrets:
api-django-secret-key:
file: secrets/API_DJANGO_SECRET_KEY
mqtt-writing-key:
file: secrets/MQTT_WRITING_KEY
postgres_password:
file: secrets/DB_PASSWORD
mqtt-reading-key:
file: secrets/MQTT_READING_KEY
emitter-license:
file: secrets/EMITTER_LICENSE
volumes:
postgres_data: