]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - Dockerfile
copy artifacts later in the build step with permissions
[github/bastienwirtz/homer.git] / Dockerfile
index ea28aa3ab2f303eb738c1f4531e895007233734c..29fda0ed766649d85897a9867b77b7f7e8bc01df 100644 (file)
@@ -12,8 +12,6 @@ RUN yarn build
 # production stage
 FROM alpine:3.11
 
-COPY --from=build-stage /app/dist /www/
-
 ENV USER darkhttpd
 ENV GROUP darkhttpd
 ENV GID 911
@@ -22,6 +20,8 @@ ENV UID 911
 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \
     apk add -U darkhttpd
 
-USER darkhttpd
+USER ${USER}
+
+COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/
 
 ENTRYPOINT ["darkhttpd","/www/", "--no-listing"]
\ No newline at end of file