Files
Lotty/deploy/compose/compose.backend.yaml
T

184 lines
4.4 KiB
YAML

services:
backend:
build:
context: ./src/backend
dockerfile: Containerfile
target: app
tags:
- lotty-backend:latest
pull: true
depends_on:
backend-initdb:
restart: false
condition: service_completed_successfully
required: true
postgresql:
restart: false
condition: service_healthy
required: true
valkey:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/configs/backend/.env.template
required: true
- path: ./infrastructure/configs/backend/.env
required: false
ports:
- name: web
target: 8080
published: ${DJANGO_PORT}
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
networks:
- default
restart: unless-stopped
shm_size: 4mb
backend-initdb:
build:
context: ./src/backend
dockerfile: Containerfile
target: app
tags:
- lotty-backend:latest
pull: true
entrypoint: ./scripts/initdb
depends_on:
postgresql:
restart: false
condition: service_healthy
required: true
valkey:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/configs/backend/.env.template
required: true
- path: ./infrastructure/configs/backend/.env
required: false
networks:
- default
restart: no
shm_size: 4mb
backend-staticfiles:
build:
context: ./src/backend
dockerfile: Containerfile
target: staticfiles
tags:
- lotty-backend-staticfiles:latest
pull: true
env_file:
- path: ./infrastructure/configs/backend/.env.template
required: true
- path: ./infrastructure/configs/backend/.env
required: false
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:80"]
interval: 30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
ports:
- name: web
target: 80
published: ${DJANGO_STATICFILES_PORT}
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
networks:
- default
restart: unless-stopped
shm_size: 4mb
backend-celery-worker:
build:
context: ./src/backend
dockerfile: Containerfile
target: app
tags:
- lotty-backend:latest
pull: true
entrypoint: ["/bin/sh", "-c"]
command: ["celery -A config worker -l INFO"]
depends_on:
valkey:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/configs/backend/.env.template
required: true
- path: ./infrastructure/configs/backend/.env
required: false
healthcheck:
test: ["CMD", "celery", "-A", "config", "inspect", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
start_interval: 2s
networks:
- default
restart: unless-stopped
shm_size: 4mb
backend-celery-beat:
build:
context: ./src/backend
dockerfile: Containerfile
target: app
tags:
- lotty-backend:latest
pull: true
entrypoint: ["/bin/sh", "-c"]
command: ["celery -A config beat -l INFO"]
depends_on:
valkey:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/configs/backend/.env.template
required: true
- path: ./infrastructure/configs/backend/.env
required: false
healthcheck:
test: ["CMD", "celery", "-A", "config", "inspect", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
start_interval: 2s
networks:
- default
restart: unless-stopped
shm_size: 4mb
celery-exporter:
image: docker.io/danihodovic/celery-exporter:latest
command:
- --retry-interval=5
depends_on:
valkey:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/configs/celery-exporter/.env.template
required: true
- path: ./infrastructure/configs/celery-exporter/.env
required: false
networks:
- default
profiles:
- observability
restart: unless-stopped
shm_size: 4mb