diff --git a/Dockerfile b/Dockerfile index 34434320a9d6c11e791b75887f9783b2283d2703..b0869588c1bee22e776cdf5f5e1d457c5ebb3730 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,23 @@ - -FROM alpine:latest +FROM nginx MAINTAINER Edward Lee -RUN apk add --no-cache \ - curl \ - git \ - openssh-client \ - rsync \ - build-base \ - libc6-compat +RUN apt-get update && \ + apt install curl -y ENV HUGO_VERSION=0.56.3 RUN mkdir -p /usr/local/src && \ cd /usr/local/src && \ curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz | tar -xz && \ - mv hugo /usr/local/bin/ && \ - addgroup -Sg 1000 hugo && \ - adduser -Sg hugo -u 1000 -h /src hugo + mv hugo /usr/local/bin/ COPY . /src/ +RUN cd /src/ && /usr/local/bin/hugo -b / && \ + cp -rf /src/public/* /usr/share/nginx/html/ && \ + chmod -R 755 /usr/share/nginx/html -RUN cd /src/ && /usr/local/bin/hugo - -WORKDIR /src - +ENV RUN_USER nginx +ENV RUN_GROUP nginx EXPOSE 80 - -# ENTRYPOINT ["hugo", "server", "--bind","0.0.0.0","-p","1313","--baseURL","http://49.4.95.151/"] +ENTRYPOINT nginx -g "daemon off;"