Skip to content

Instantly share code, notes, and snippets.

@mstfsnc
Created Oct 9, 2019
Embed
What would you like to do?
version: '3.7'
services:
database:
image: postgres:11.4-alpine
volumes:
- database:/var/lib/postgresql/data/
ports:
- 5433:5432
env_file:
- .env
web:
image: image:latest
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 80:8000
depends_on:
- database
entrypoint: /entrypoint.sh
env_file:
- .env
links:
- database
volumes:
database:
FROM python:3.7-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
RUN pip install --upgrade pip && pip install pipenv
COPY Pipfile Pipfile.lock /code/
RUN pipenv install --system
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment