File size: 619 Bytes
0827183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

FROM python:3.7-slim as pkg_holder

ARG EXTRA_INDEX_URL
RUN pip config set global.extra-index-url "${EXTRA_INDEX_URL}"

COPY requirements.txt .
RUN pip download -r requirements.txt -d packages

FROM python:3.7-slim

ENV VIRTUAL_ENV=/opt/venv
RUN python3.7 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

COPY . /app
WORKDIR /app

COPY --from=pkg_holder packages packages

RUN pip install -r requirements.txt --no-index --find-links=packages && rm -rf packages

ENTRYPOINT ["python"]
EXPOSE 3978
CMD ["runserver.py"]