You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Broker/docker-compose.yaml

83 lines
2.2 KiB
YAML

version: '3'
services:
# This is the database server that is used by Django
db:
container_name: postgresdb
image: postgres:latest
restart: always
env_file:
- docker/project.env
# ports:
# - 5432:5432
volumes:
- postgres-data:/var/lib/postgresql/data
# This is the redis server for HUEY (background processes)
redis:
container_name: redisdb
image: redis
env_file:
- docker/project.env
# We need the 'bash' command in order to get the environment variables
command: bash -c 'redis-server --requirepass "$${REDIS_PASSWORD}" --appendonly yes'
restart: always
volumes:
- redis-data:/data
# The Django API REST server. This should only be used for API calls
# TODO: Cleanup / split code better between API, scheduler and portal
broker-api:
container_name: broker_api
env_file:
- docker/project.env
# This feels like bad practice....
build:
context: ./
dockerfile: ./docker/Dockerfile.api
# command: gunicorn wsgi:application --bind 0.0.0.0:8000 --workers=4
# ports:
# - 8800:8000
depends_on:
- db
- redis
volumes:
- staticfiles:/home/app/web/staticfiles
# The standaard NGINX server in front of the API. This will filter out all non API calls (/api/)
# And will also server as a static file server for the API documentation
broker-api-ngx:
container_name: broker_api_ngx
env_file:
- docker/project.env
build:
context: ./
dockerfile: ./docker/Dockerfile.nginx
restart: always
ports:
- 1337:80
depends_on:
- broker-api
volumes:
- staticfiles:/var/www/staticfiles
# The API background scheduler based on Django and HUEY. Needs a Redis server
# This will process background tasks like creating new VPS machines
broker-scheduler:
container_name: broker_scheduler
env_file:
- docker/project.env
# This feels like bad practice....
build:
context: ./
dockerfile: ./docker/Dockerfile.scheduler
command: python manage.py run_huey
depends_on:
- broker-api
- db
- redis
volumes:
postgres-data:
redis-data:
staticfiles: