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.
depot_django/docker-compose-deploy.yml

86 lines
1.9 KiB
YAML

version: '3.8'
services:
database:
image: postgres
environment:
- POSTGRES_DB=depot
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d depot"]
interval: 5s
timeout: 5s
retries: 5
networks:
- app-network
web:
image: depot-web
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- production.env
depends_on:
database:
condition: service_healthy
minio:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
networks:
- app-network
command: >
bash -c "python manage.py collectstatic --noinput --verbosity 3 &&\
python manage.py migrate &&\
gunicorn DepoT.wsgi:application --bind 0.0.0.0:8000 --workers 3"
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: kikimor
MINIO_ROOT_PASSWORD: shushunka1
MINIO_SERVER_URL: http://localhost:9000
volumes:
- minio_data:/data
command: server --console-address ":9001" /data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 30s
timeout: 20s
retries: 3
networks:
- app-network
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 kikimor shushunka1;
mc mb myminio/damages;
mc mb myminio/static;
mc anonymous set public myminio/damages;
mc anonymous set public myminio/static;
"
networks:
- app-network
volumes:
postgres_data:
minio_data:
networks:
app-network:
driver: bridge