forked from SIOS-Svalbard/Nansen_Legacy_logging_system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (23 loc) · 802 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
FROM python:3.8-slim AS builder
WORKDIR /app
COPY requirements.txt .
COPY main.py .
COPY flaskapp.wsgi .
# COPY config.json .
RUN apt-get clean
RUN apt-get update \
&& apt-get -y install libpq-dev gcc rsync\
&& pip install -v -r requirements.txt \
&& rm -rf /root/.cache
RUN mkdir -p /folder_to_copy/usr/local/lib/python3.8/site-packages \
&& rsync -a /usr/local/lib/python3.8/site-packages /folder_to_copy/usr/local/lib/python3.8 \
&& rsync -a /usr/local/bin /folder_to_copy/usr/local \
&& rsync -a /usr/bin /folder_to_copy/usr \
&& rsync -a /usr/lib /folder_to_copy/usr
RUN apt-get -y purge rsync
ADD website /app/website
FROM python:3.8-slim
WORKDIR /app
COPY --from=builder /app .
COPY --from=builder /folder_to_copy /
ENTRYPOINT [ "python", "/app/main.py" ]