repcofkk/docker-compose.yml
2023-12-27 17:56:17 +07:00

40 lines
884 B
YAML

version: "3.9"
services:
yt_postgres:
image: postgres:15
container_name: yt_postgres
volumes:
- ~/.pg/pg_data/yt:/var/lib/postgresql/data
env_file:
- .env
youtube_project:
image: yt_django:latest
container_name: yt_django
depends_on:
- yt_postgres
volumes:
- static_volume:/yt/static
- media_volume:/yt/media
env_file:
- .env
command: >
bash -c "./manage.py collectstatic --noinput && ./manage.py migrate && gunicorn -b 0.0.0.0:8000 soaqaz.wsgi:application"
nginx:
build:
dockerfile: ./Dockerfile
context: ./docker/nginx/
container_name: yt_nginx
image: yt_nginx
volumes:
- static_volume:/yt/static
- media_volume:/yt/media
depends_on:
- youtube_project
ports:
- "${NGINX_EXTERNAL_PORT}:80"
volumes:
static_volume:
media_volume: