1
0
mirror of https://github.com/taigrr/homer synced 2025-01-18 04:53:12 -08:00

Merge pull request #84 from calvinbui/master

Dockerfile Improvements
This commit is contained in:
Bastien Wirtz 2020-06-11 21:50:00 -07:00 committed by GitHub
commit cad54a560f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN yarn install RUN yarn install --frozen-lockfile
COPY . . COPY . .
RUN yarn build RUN yarn build
@ -12,8 +12,6 @@ RUN yarn build
# production stage # production stage
FROM alpine:3.11 FROM alpine:3.11
COPY --from=build-stage /app/dist /www/
ENV USER darkhttpd ENV USER darkhttpd
ENV GROUP darkhttpd ENV GROUP darkhttpd
ENV GID 911 ENV GID 911
@ -22,6 +20,8 @@ ENV UID 911
RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
apk add -U darkhttpd apk add -U darkhttpd
USER darkhttpd USER ${USER}
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] ENTRYPOINT ["darkhttpd","/www/", "--no-listing"]

View File

@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN yarn install RUN yarn install --frozen-lockfile
COPY . . COPY . .
RUN yarn build RUN yarn build
@ -20,7 +20,6 @@ RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_
FROM arm32v7/alpine:3.11 FROM arm32v7/alpine:3.11
COPY --from=qemu qemu-arm-static /usr/bin/ COPY --from=qemu qemu-arm-static /usr/bin/
COPY --from=build-stage /app/dist /www/
ENV USER darkhttpd ENV USER darkhttpd
ENV GROUP darkhttpd ENV GROUP darkhttpd
@ -31,6 +30,8 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} &
apk add -U darkhttpd && \ apk add -U darkhttpd && \
rm /usr/bin/qemu-arm-static rm /usr/bin/qemu-arm-static
USER darkhttpd USER ${USER}
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
ENTRYPOINT ["darkhttpd","/www/","--no-listing"] ENTRYPOINT ["darkhttpd","/www/","--no-listing"]

View File

@ -4,7 +4,7 @@ FROM node:lts-alpine as build-stage
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN yarn install RUN yarn install --frozen-lockfile
COPY . . COPY . .
RUN yarn build RUN yarn build
@ -20,7 +20,6 @@ RUN wget https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_
FROM arm64v8/alpine:3.11 FROM arm64v8/alpine:3.11
COPY --from=qemu qemu-aarch64-static /usr/bin/ COPY --from=qemu qemu-aarch64-static /usr/bin/
COPY --from=build-stage /app/dist /www/
ENV USER darkhttpd ENV USER darkhttpd
ENV GROUP darkhttpd ENV GROUP darkhttpd
@ -31,6 +30,8 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} &
apk add -U darkhttpd && \ apk add -U darkhttpd && \
rm /usr/bin/qemu-aarch64-static rm /usr/bin/qemu-aarch64-static
USER darkhttpd USER ${USER}
COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
ENTRYPOINT ["darkhttpd","/www/","--no-listing"] ENTRYPOINT ["darkhttpd","/www/","--no-listing"]