FROM klakegg/hugo:ext

RUN apt-get update && apt-get install busybox

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

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

WORKDIR /home/static
RUN hugo

RUN chown -R static:static /home/static
USER static

# Run BusyBox httpd
ENTRYPOINT ["busybox", "httpd", "-f", "-v", "-p", "3000", "-h", "public"]
