Guest User

Untitled

a guest
Nov 18th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. # base image
  2. FROM python:3.7
  3.  
  4. # Set environment variables
  5. ENV PYTHONDONTWRITEBYTECODE 1
  6. ENV PYTHONUNBUFFERED 1
  7.  
  8. # Set work directory
  9. RUN mkdir /code
  10. WORKDIR /code
  11.  
  12. # Install dependencies
  13. RUN pip3 install --upgrade pip
  14. RUN pip3 install pipenv
  15.  
  16. # Copy Pipfile at the project
  17. COPY ./Pipfile /code/Pipfile
  18.  
  19. # Install packages
  20. RUN pipenv install --system --deploy --skip-lock --dev
  21.  
  22. # Copy all code at the project
  23. COPY . /code/
  24.  
  25. version: '3'
  26.  
  27. services:
  28. db:
  29. image: postgres
  30. environment:
  31. POSTGRES_PASSWORD: pass
  32. POSTGRES_USER: user
  33. web:
  34. restart: always
  35. build: .
  36. volumes:
  37. - ./code/src
  38. command: >
  39. bash -c "python3.7 src/manage.py migrate &&
  40. python3.7 src/manage.py loaddata dump_bd.json &&
  41. python3.7 src/manage.py runserver 0.0.0.0:8000"
  42. ports:
  43. - "8000:8000"
  44. depends_on:
  45. - db
Add Comment
Please, Sign In to add comment