-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
36 lines (27 loc) · 943 Bytes
/
Dockerfile.prod
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
36
# Use an official Python runtime as parent image
FROM python:3.7.4-alpine
# Set the working directory
WORKDIR /usr/src/dist
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install required packages
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
&& pip install psycopg2 \
&& apk del build-deps
# Install pipenv
RUN pip install --upgrade pip
RUN pip install pipenv
# Copy Pipfiles to WORKDIR
COPY ./Pipfile /usr/src/dist/Pipfile
COPY ./Pipfile.lock /usr/src/dist/Pipfile.lock
# Install any needed packages specified in the Pipfile.lock
RUN pipenv install --system --ignore-pipfile --deploy
# Copy entrypoint.prod.sh
COPY ./conf/entrypoint.prod.sh /usr/src/dist/conf/entrypoint.prod.sh
# Copy the current directory contents into the container
COPY . /usr/src/dist
# Run entrypoint.sh
ENTRYPOINT ["/usr/src/dist/conf/entrypoint.prod.sh"]