Skip to content

Instantly share code, notes, and snippets.

@rririanto
Created May 12, 2021 05:51
Show Gist options
  • Save rririanto/b93424668728bb9d288bf8ca7f0bb606 to your computer and use it in GitHub Desktop.
Save rririanto/b93424668728bb9d288bf8ca7f0bb606 to your computer and use it in GitHub Desktop.
dockerfile
# pull official python alpine image
FROM python:3.7
# Set Environment Variable
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true
RUN mkdir -p /opt/django/dev
# Creating Work Directory
WORKDIR /opt/django/dev
# Adding mandatory packages to docker
RUN apt-get -q update && apt-get install -y --no-install-recommends \
libpq-dev && rm -rf /var/lib/apt/lists/*
# Update pip
RUN pip install --upgrade pip
# Installing requirements.pip from project
ADD fweb/requirements/production.txt /opt/django/dev/
RUN pip install --no-cache-dir -r production.txt
ADD fweb/ /opt/django/dev/
# CMD will run when this dockerfile is running
CMD ["sh", "-c", "gunicorn -b :80 --workers=3 config.wsgi:application"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment