-
Notifications
You must be signed in to change notification settings - Fork 224
/
Dockerfile
44 lines (33 loc) · 1.08 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
#
# Builder Stage
#
FROM python:3.9-alpine AS builder
# Set working directory
WORKDIR /usr/src/app
# Install dependencies
COPY ./requirements.txt .
# Add needed packages
RUN echo "\n===> Installing apk...\n" && \
apk add --update --no-cache g++ && \
apk add --no-cache gcc && \
apk add --no-cache libxslt-dev && \
echo "\n===> Python build Wheel archives for requirements...\n" && \
pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt && \
echo "\n===> Removing package list...\n" && \
rm -rf /var/cache/apk/*
#
# Runtime Stage
#
FROM builder as RUNTIME
LABEL name="pystemon" \
description="Monitoring tool for PasteBin-alike sites written in Python" \
url="https://github.com/cvandeplas/pystemon" \
maintainer="[email protected]"
WORKDIR /opt/pystemon
COPY --from=builder /usr/src/app/wheels /wheels
RUN echo "\n===> Custom tuning...\n" && \
pip install --upgrade --no-cache pip && \
pip install --no-cache /wheels/*
# copy project
COPY . /opt/pystemon
ENTRYPOINT ["/opt/pystemon/pystemon.py"]