Advertisement
AntonDnepr

Compose yml example file

Dec 10th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.21 KB | None | 0 0
  1. version: '3.2'
  2.  
  3. volumes:
  4.   postgres_data:
  5. services:
  6.  postgres:
  7.     build: ./docker/postgres
  8.     container_name: ${PROJECT_NAME}_postgres
  9.     image: ${PROJECT_NAME}_postgres
  10.     command: -c fsync=off -c synchronous_commit=off -c full_page_writes=off
  11.     restart: on-failure
  12. volumes:
  13.    - postgres_data:/var/lib/postgresql/data
  14.     ports:
  15.      - "${DOCKER_POSTGRES_PORT}:5432"
  16.     environment:
  17.       POSTGRES_USER: ${DB_USER}
  18.       POSTGRES_DB: ${PROJECT_NAME}
  19.       POSTGRES_PASSWORD: ${DB_PASSWORD}
  20.     networks:
  21.      - default
  22.  
  23.   backend:
  24.     build: ./docker/python
  25.     container_name: ${PROJECT_NAME}_backend
  26.     image: ${PROJECT_NAME}_backend
  27.     command: /bin/bash -c "PIPENV_DONT_LOAD_ENV=1 pipenv install --system --deploy && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
  28.     restart: on-failure
  29.     volumes: .:/usr/src/app
  30.     ports:
  31.      - "${DOCKER_BACKEND_PORT}:8000"
  32.     working_dir: /usr/src/app
  33.     environment:
  34.      - DJANGO_DEBUG=True
  35.       - DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgres:5432/${PROJECT_NAME}
  36.       - ALLOWED_HOSTS=*
  37.       - DJANGO_SECRET_KEY=notsafeforproduction
  38.     networks:
  39.      - default
  40.     depends_on:
  41.      - postgres
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement