-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamd64.dockerfile
57 lines (45 loc) · 1.29 KB
/
amd64.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
# :: Util
FROM alpine as util
RUN set -ex; \
apk add --no-cache \
git; \
git clone https://github.com/11notes/util.git;
# :: Build
FROM 11notes/node:stable as build
ARG BUILD_VERSION=1.4.2
ARG BUILD_ROOT=/immich-share-proxy
USER root
COPY ./node /${BUILD_ROOT}
RUN set -ex; \
cd ${BUILD_ROOT}; \
npm install --save --omit=dev; \
npx tsc --noCheck; \
mkdir -p /node; \
cp -R ${BUILD_ROOT}/* /node;
# :: Header
FROM 11notes/node:stable
COPY --from=util /util/docker /usr/local/bin
COPY --from=build /node /node
ENV NODE_ENV=production
ENV APP_NAME="immich-share-proxy"
ENV APP_VERSION=1.4.2
ENV IMMICH_URL="http://immich.server:2283"
# :: Run
USER root
# :: prepare image
RUN set -ex; \
apk --no-cache --update upgrade;
# :: copy root filesystem changes and add execution rights to init scripts
COPY --chown=1000:1000 ./rootfs /
RUN set -ex; \
chmod +x -R /usr/local/bin;
# :: change home path for existing user and set correct permission
RUN set -ex; \
usermod -d ${APP_ROOT} docker; \
chown -R 1000:1000 \
${APP_ROOT};
# :: Monitor
HEALTHCHECK --interval=5s --timeout=3s CMD /usr/local/bin/healthcheck.sh || exit 1
# :: Start
USER docker
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]