forked from devroastproject/devroastproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-alpine
EXPOSE 8000
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Setup the virtualenvironment
ENV VIRTUAL_ENV=/app/ve
# install psycopg2 dependencies
RUN apk update \
&& apk add postgresql-dev gcc python3-dev musl-dev py3-virtualenv
# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN adduser --disabled-password --home /app appuser && chown -R appuser /app
USER appuser
WORKDIR /app
# Make an /app virtualenv with all pre-requisites installed
RUN cd /app && virtualenv -p python ${VIRTUAL_ENV} && ${VIRTUAL_ENV}/bin/python -m pip install --upgrade pip
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR /app/code
COPY requirements.txt /app/code
RUN pip install -r requirements.txt
# Copy our current app source over it for fast dev iteration.
COPY --chown=appuser . /app/code
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "devroast.wsgi"]