-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (52 loc) · 2.01 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM alpine:3.20 AS rootfs-stage
ARG S6_OVERLAY_VERSION="3.2.0.0"
ARG TARGETPLATFORM
RUN apk add --no-cache \
curl \
bash \
xz
RUN mkdir /root-out/
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C /root-out/ -Jxpf /tmp/s6-overlay-noarch.tar.xz
RUN case ${TARGETPLATFORM} in \
"linux/amd64") S6_OVERLAY_ARCH="x86_64" ;; \
"linux/arm/v7") S6_OVERLAY_ARCH="armhf" ;; \
"linux/arm64") S6_OVERLAY_ARCH="aarch64" ;; \
*) S6_OVERLAY_ARCH="x86_64" ;; \
esac \
&& curl -s -L https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz \
--output /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz \
&& tar -C /root-out/ -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz
# add s6 optional symlinks
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
RUN tar -C /root-out/ -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp
RUN tar -C /root-out/ -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz
FROM python:3.12-alpine3.20
WORKDIR /app
COPY --from=rootfs-stage /root-out/ /
ENV PYTHONDONTWRITEBYTECODE=1
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
alpine-release \
bash \
ca-certificates \
coreutils \
shadow \
tzdata && \
echo "**** create abc user and create /data folder ****" && \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p /data \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# copy app and services
COPY tmdb_notifier/ tmdb_notifier/
COPY etc/ /etc/
ENTRYPOINT ["/init"]