-
Notifications
You must be signed in to change notification settings - Fork 141
/
Dockerfile
48 lines (39 loc) · 1.1 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
45
46
47
48
ARG PY_VERSION=3.12
FROM python:${PY_VERSION} as base
FROM base as builder
ARG PY_VERSION
ARG WITH_S3
RUN mkdir /install
WORKDIR /install
RUN pip install --target="/install" --upgrade pip setuptools wheel
ADD requirements_s3.txt /install
ADD requirements.txt /install
RUN if [ ! -z "$WITH_S3" ] \
; then \
pip install --target="/install" \
-r requirements.txt \
-r requirements_s3.txt \
; else \
pip install --target="/install" \
-r requirements.txt \
; fi
FROM python:${PY_VERSION}-slim
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ARG PY_VERSION
ARG WITH_S3
COPY --from=builder /install /usr/local/lib/python${PY_VERSION}/site-packages
RUN mkdir /bandersnatch && mkdir /conf && chmod 777 /conf
WORKDIR /bandersnatch
COPY setup.cfg /bandersnatch
COPY setup.py /bandersnatch
COPY README.md /bandersnatch
COPY LICENSE /bandersnatch
COPY src /bandersnatch/src
RUN if [ ! -z "$WITH_S3" ] \
; then \
pip --no-cache-dir install /bandersnatch/[s3] \
; else \
pip --no-cache-dir install /bandersnatch/ \
; fi
CMD ["python", "/bandersnatch/src/runner.py", "3600"]