aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2020-06-11 21:50:00 -0700
committerGitHub <noreply@github.com>2020-06-11 21:50:00 -0700
commitcad54a560f77382d9584fd804f9cdd84c92012b7 (patch)
tree58f66b28a3fba8eb32d29b45022385f4734853ef
parenta23914d573841f9088cc9cd69bce24c28f432acf (diff)
parente6596ca6eea8792cb6b1a6a2e1c48b8ed44093cd (diff)
downloadhomer-cad54a560f77382d9584fd804f9cdd84c92012b7.tar.gz
homer-cad54a560f77382d9584fd804f9cdd84c92012b7.tar.zst
homer-cad54a560f77382d9584fd804f9cdd84c92012b7.zip
Merge pull request #84 from calvinbui/master132942766
Dockerfile Improvements
-rw-r--r--Dockerfile8
-rw-r--r--Dockerfile.arm32v77
-rw-r--r--Dockerfile.arm64v87
3 files changed, 12 insertions, 10 deletions
diff --git a/Dockerfile b/Dockerfile
index ea28aa3..205d759 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
4WORKDIR /app 4WORKDIR /app
5 5
6COPY package*.json ./ 6COPY package*.json ./
7RUN yarn install 7RUN yarn install --frozen-lockfile
8 8
9COPY . . 9COPY . .
10RUN yarn build 10RUN yarn build
@@ -12,8 +12,6 @@ RUN yarn build
12# production stage 12# production stage
13FROM alpine:3.11 13FROM alpine:3.11
14 14
15COPY --from=build-stage /app/dist /www/
16
17ENV USER darkhttpd 15ENV USER darkhttpd
18ENV GROUP darkhttpd 16ENV GROUP darkhttpd
19ENV GID 911 17ENV GID 911
@@ -22,6 +20,8 @@ ENV UID 911
22RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ 20RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
23 apk add -U darkhttpd 21 apk add -U darkhttpd
24 22
25USER darkhttpd 23USER ${USER}
24
25COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
26 26
27ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] \ No newline at end of file 27ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] \ No newline at end of file
diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7
index 2113df5..7664f66 100644
--- a/Dockerfile.arm32v7
+++ b/Dockerfile.arm32v7
@@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
4WORKDIR /app 4WORKDIR /app
5 5
6COPY package*.json ./ 6COPY package*.json ./
7RUN yarn install 7RUN yarn install --frozen-lockfile
8 8
9COPY . . 9COPY . .
10RUN yarn build 10RUN yarn build
@@ -20,7 +20,6 @@ RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_
20FROM arm32v7/alpine:3.11 20FROM arm32v7/alpine:3.11
21 21
22COPY --from=qemu qemu-arm-static /usr/bin/ 22COPY --from=qemu qemu-arm-static /usr/bin/
23COPY --from=build-stage /app/dist /www/
24 23
25ENV USER darkhttpd 24ENV USER darkhttpd
26ENV GROUP darkhttpd 25ENV GROUP darkhttpd
@@ -31,6 +30,8 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} &
31 apk add -U darkhttpd && \ 30 apk add -U darkhttpd && \
32 rm /usr/bin/qemu-arm-static 31 rm /usr/bin/qemu-arm-static
33 32
34USER darkhttpd 33USER ${USER}
34
35COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
35 36
36ENTRYPOINT ["darkhttpd","/www/","--no-listing"] 37ENTRYPOINT ["darkhttpd","/www/","--no-listing"]
diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8
index 90d35f3..0175341 100644
--- a/Dockerfile.arm64v8
+++ b/Dockerfile.arm64v8
@@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
4WORKDIR /app 4WORKDIR /app
5 5
6COPY package*.json ./ 6COPY package*.json ./
7RUN yarn install 7RUN yarn install --frozen-lockfile
8 8
9COPY . . 9COPY . .
10RUN yarn build 10RUN yarn build
@@ -20,7 +20,6 @@ RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_
20FROM arm64v8/alpine:3.11 20FROM arm64v8/alpine:3.11
21 21
22COPY --from=qemu qemu-aarch64-static /usr/bin/ 22COPY --from=qemu qemu-aarch64-static /usr/bin/
23COPY --from=build-stage /app/dist /www/
24 23
25ENV USER darkhttpd 24ENV USER darkhttpd
26ENV GROUP darkhttpd 25ENV GROUP darkhttpd
@@ -31,6 +30,8 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} &
31 apk add -U darkhttpd && \ 30 apk add -U darkhttpd && \
32 rm /usr/bin/qemu-aarch64-static 31 rm /usr/bin/qemu-aarch64-static
33 32
34USER darkhttpd 33USER ${USER}
34
35COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
35 36
36ENTRYPOINT ["darkhttpd","/www/","--no-listing"] 37ENTRYPOINT ["darkhttpd","/www/","--no-listing"]