Composing services using docker-compose.yaml
Now let us explore how to create a docker-compose.yaml
file that orchestrates our Django project, Celery, Celery Beat, Postgres, and Redis services together. Add the following code to the /
myblog/docker-compose.yml
file:
version: "3.8" services: postgresql_db: image: postgres:16.1 volumes: - ~/volumes/proj/dip/postgres/:/var/lib/postgresql/data/ ports: - 5432:5432 env_file: - ./.env environment: - POSTGRES_USER=${DB_USERNAME} - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_DB=${DB_NAME} redis_db: image: redis:7.2 container_name...