From 4de4f71af7e9e1bba54c712886ecef5dc4eb7168 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 9 Aug 2018 05:16:20 +0800 Subject: [PATCH] improvement: update Dockerfile (#4799) * [Dockerfile] Use `--no-cache` instead of `--update` for `apk add` To prevent unnecessary cache in the Docker image. * [Dockerfile] Use `COPY` instead of `ADD` for non tarball file copying * [Dockerfile] Update base image from Alpine v3.5 to v3.8 --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff4f7540..5a8741b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.5 +FROM alpine:3.8 LABEL maintainer="fehguy" @@ -16,14 +16,14 @@ ENV SWAGGER_JSON "/app/swagger.json" ENV PORT 8080 ENV BASE_URL "" -RUN apk add --update nginx +RUN apk add --no-cache nginx RUN mkdir -p /run/nginx COPY nginx.conf /etc/nginx/ # copy swagger files to the `/js` folder -ADD ./dist/* /usr/share/nginx/html/ -ADD ./docker-run.sh /usr/share/nginx/ +COPY ./dist/* /usr/share/nginx/html/ +COPY ./docker-run.sh /usr/share/nginx/ EXPOSE 8080