-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (40 loc) · 1.64 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
FROM node:16-alpine3.15 AS npm-ci
SHELL ["/bin/ash", "-euo", "pipefail", "-c"]
WORKDIR /hue-fireplace
COPY . ./
RUN apk add --no-cache python3~=3.9 make~=4.3 g++~=10.3 && \
npm ci && \
npm run build:dist && \
cp package* dist/src && \
cd dist/src && \
npm ci
FROM node:16-alpine3.15
SHELL ["/bin/ash", "-euo", "pipefail", "-c"]
COPY /docker/just-containers.asc /tmp/just-containers.asc
RUN apk add --no-cache --virtual /tmp/.gpg gnupg~=2.2 && \
# Set correct architecture for s6-overlay
case $(arch) in \
aarch64) arch=aarch64 ;; \
armv7l) arch=armhf ;; \
x86_64) arch=amd64 ;; \
*) echo "Invalid architecture '$(arch)'" && exit 1 ;; \
esac && \
# Download just-containers s6-overlay installer and its signature
wget -nv -O /tmp/s6-installer \
"https://github.com/just-containers/s6-overlay/releases/download/v2.1.0.2/s6-overlay-$arch-installer" && \
wget -nv -O /tmp/s6-installer.sig \
"https://github.com/just-containers/s6-overlay/releases/download/v2.1.0.2/s6-overlay-$arch-installer.sig" && \
# Import just-containers' public key; use gpgv to validate installer
gpg --no-default-keyring --keyring /tmp/s6-installer.gpg --import /tmp/just-containers.asc && \
gpgv --keyring /tmp/s6-installer.gpg /tmp/s6-installer.sig /tmp/s6-installer && \
# Execute the installer
chmod +x /tmp/s6-installer && /tmp/s6-installer / && \
# Cleanup
rm /tmp/s6-installer* && \
apk del /tmp/.gpg
COPY /docker/rootfs/ ./
WORKDIR /hue-fireplace
COPY --from=npm-ci /hue-fireplace/dist/src/. ./
# Restore SHELL to its default
SHELL ["/bin/sh", "-c"]
ENTRYPOINT ["/init"]