From fc2554994ec6b31cf2d15825f01e01d5aee62e0f Mon Sep 17 00:00:00 2001 From: fechin Date: Sat, 24 Dec 2022 10:18:45 +0800 Subject: [PATCH] Dockerfile --- Dockerfile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64a8a09..34396c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ -# https://github.com/lipanski/docker-static-website -FROM lipanski/docker-static-website:latest +FROM alpine:latest -# Copy your static files -COPY public . \ No newline at end of file +# Install thttpd +RUN apk add thttpd + +# Create a non-root user to own the files and run our server +RUN adduser -D static +USER static +WORKDIR /home/static + +# Copy the static website +# Use the .dockerignore file to control what ends up inside the image! +COPY public . + +# Run thttpd +CMD ["thttpd", "-D", "-h", "0.0.0.0", "-p", "3000", "-d", "/home/static", "-u", "static", "-l", "-", "-M", "60"] + +EXPOSE 3000