SUBANGKAR

docker-compose

Aug 1st, 2020 (edited)
2,983
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: '3'
  2. services:
  3.   db:
  4.     image: postgres
  5.     environment:
  6.      - POSTGRES_DB=foodsquare
  7.       - POSTGRES_USER=postgres
  8.       - POSTGRES_PASSWORD=postgres
  9.     ports:
  10.      - '5432'
  11.   web:
  12.     image: subangkar/foodsquare
  13.     command: sh -c "while ! nc -z db 5432; do sleep 1; done; ./startdatabase.sh && python3 manage.py runserver 0.0.0.0:8000"
  14.     ports:
  15.      - '8000:8000'
  16.     depends_on:
  17.      - db
  18.  
  19. # docker-compose up
  20. # docker-compose run web python3 manage.py migrate
RAW Paste Data