Skip to content

Commit 0a89ae4

Browse files
committed
new multi-stage docker file
1 parent befbe95 commit 0a89ae4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
FROM python:3.7-slim
2-
ENV PYTHONUNBUFFERED 1
1+
FROM python:3.7-slim AS compile-image
32
RUN apt-get update \
43
&& apt-get install -y build-essential libmariadbclient-dev \
54
&& rm -rf /var/lib/apt/lists/*
6-
RUN mkdir /weather
5+
COPY requirements.txt .
6+
RUN pip install --user -r requirements.txt
7+
8+
FROM python:3.7-slim
9+
RUN apt-get update \
10+
&& apt-get install -y mariadb-client \
11+
&& rm -rf /var/lib/apt/lists/*
12+
COPY --from=compile-image /root/.local /root/.local
13+
ENV PATH=/root/.local/bin:$PATH
714
WORKDIR /weather
8-
COPY requirements.txt /weather/
9-
RUN pip install -r requirements.txt
1015
COPY . /weather/
1116
CMD gunicorn --bind 0.0.0.0:8002 --workers=6 --threads=3 --worker-class=gthread pyobs_weather.wsgi

0 commit comments

Comments
 (0)