-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
33 lines (26 loc) · 890 Bytes
/
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
###########################################
# Generate package wheel files
FROM python:3.8-slim-buster as package
ENV PYTHONUNBU FFERED 1
RUN pip install --upgrade pip
COPY requirements.txt .
RUN pip wheel -w /root/wheels -r requirements.txt
###########################################
# Run django api server
FROM python:3.8-slim-buster as builder
ENV PYTHONUNBU FFERED 1
RUN apt-get update -y \
&& apt-get -f install \
&& apt-get upgrade -y \
&& apt-get clean \
&& pip install --upgrade pip
# Install packages
WORKDIR /code
COPY --from=package /root/wheels /root/wheels
COPY requirements.txt .
RUN pip install --no-index --find-links=/root/wheels -r requirements.txt
# Adds our application code to the image
COPY . .
EXPOSE 8333
# Run the production server
# CMD newrelic-admin run-program gunicorn --bind 0.0.0.0:$PORT --access-logfile - msof_api.wsgi:application