FROM hugomods/hugo:exts

RUN apk update && apk add nginx 

# Create a non-root user to own the files and run our server
RUN adduser -D static

RUN chown -R static:static /home/static && mkdir -p /var/lib/nginx/tmp/client_body && chown -R static:static /var/lib/nginx

# Copy the static website
# Use the .dockerignore file to control what ends up inside the image!
COPY . /home/static

WORKDIR /home/static
RUN hugo -d public -b https://adriano.fyi
USER static
EXPOSE 3000
ENTRYPOINT ["nginx", "-e", "/dev/stderr", "-c", "/home/static/nginx.conf" ]
