forked from t0mer/dockerbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 886 Bytes
/
Dockerfile
File metadata and controls
36 lines (28 loc) · 886 Bytes
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
# Base image
FROM python:slim as base
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PROJECT_NAME dockerbot
LABEL ${PROJECT_NAME}.image=base
# Staging image
FROM base as builder
ENV PROJECT_NAME dockerbot
LABEL ${PROJECT_NAME}.image=builder
# Dev packages needed for compilation of PIP packages
RUN apt-get update \
&& apt-get install libc-dev gcc -y --no-install-recommends \
&& apt-get clean
COPY requirements.txt /
RUN pip install --trusted-host pypi.python.org --user --no-cache-dir --no-warn-script-location -r /requirements.txt
# Here is the production image
FROM base as app
ENV PROJECT_NAME dockerbot
LABEL ${PROJECT_NAME}.image=application
COPY --from=builder /root/.local /root/.local
COPY dockerbot.py /opt/dockerbot/
WORKDIR /opt/dockerbot
ENV PATH=/root/.local/bin:$PATH
ENTRYPOINT ["python"]
CMD ["/opt/dockerbot/dockerbot.py"]