Advertisement
AsmodaiP

docker-compose

Dec 7th, 2021
723
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.74 KB | None | 0 0
  1.  
  2. version: '3.8'
  3.  
  4. services:
  5.   db:
  6.     image: postgres:13.0-alpine
  7.     volumes:
  8.      - postgres_data:/var/lib/postgresql/data/
  9.     env_file:
  10.      - ./.env
  11.   web:
  12.     build:
  13.       context: ../api_yamdb
  14.       dockerfile: Dockerfile
  15.     restart: always
  16.  
  17.     ports:
  18.      - "8000:8000"
  19.     volumes:
  20.      - static_value:/code/static/
  21.       - media_value:/code/media/
  22.     depends_on:
  23.      - db
  24.     env_file:
  25.      - ./.env
  26.  
  27.   nginx:
  28.     image: nginx:1.19.3
  29.     ports:
  30.      - "80:80"
  31.  
  32.     volumes:
  33.      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
  34.       - static_value:/var/html/static/
  35.       - media_value:/var/html/media/
  36.  
  37.     depends_on:
  38.      - web
  39.  
  40. volumes:
  41.   postgres_data:
  42.   static_value:
  43.   media_value:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement