28 lines
660 B
Docker
28 lines
660 B
Docker
FROM alpine:3.7
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
RUN apk add --no-cache \
|
|
python3 \
|
|
py3-gunicorn
|
|
|
|
COPY requirements.txt .
|
|
RUN pip3 install --upgrade pip && \
|
|
pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
# For production: build mysql dependencies
|
|
RUN apk add --virtual build-deps gcc python3-dev musl-dev && \
|
|
apk add --no-cache mariadb-dev && \
|
|
pip3 install --no-cache-dir mysqlclient && \
|
|
apk del build-deps
|
|
|
|
COPY . .
|
|
|
|
# Create symlink to manage.py script in PATH
|
|
RUN ln -s /usr/src/app/manage.py /usr/local/bin/manage.py
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["gunicorn", "pluralityspace.wsgi:application", \
|
|
"--bind", "0.0.0.0:8000"]
|