Created
September 26, 2019 21:00
-
-
Save maurobaraldi/6f29c79d97f7f20d3e1a798881215fd3 to your computer and use it in GitHub Desktop.
Dockerfile Alpine based with Python3 + Django + lxml + PyCrypto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6-alpine | |
ENV PYTHONUNBUFFERED 1 | |
ARG git_username | |
ARG git_password | |
EXPOSE 8004 | |
RUN mkdir /opt/app | |
WORKDIR /opt/app | |
COPY . /opt/app | |
RUN apk update && \ | |
apk add --no-cache git \ | |
gcc \ | |
g++ \ | |
make \ | |
libffi-dev \ | |
openssl-dev \ | |
python3-dev \ | |
build-base \ | |
musl-dev \ | |
libxml2 \ | |
libxml2-dev \ | |
libxslt-dev \ | |
postgresql-dev | |
RUN sed -i 's@${git_username}@'"$git_username"'@' requirements-docker.txt | |
RUN sed -i 's@${git_password}@'"$git_password"'@' requirements-docker.txt | |
RUN pip install --no-cache-dir -r requirements-docker.txt | |
RUN pip install --no-cache-dir gunicorn | |
RUN mv .env.homologacao .env | |
RUN python manage.py migrate | |
CMD gunicorn wsgi -b :8004 -w 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment