Last active
September 3, 2024 04:01
-
-
Save NorikDavtian/52e7e15dafeb806e2cd8b077d6223ec8 to your computer and use it in GitHub Desktop.
Static site dockerfile for static site with busybox minimal httpd server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
ADD . /app/ | |
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
# 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 . . | |
# Run BusyBox httpd | |
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"] | |
#docker build -t norik.io . | |
#docker run -it --rm -p 3000:3000 norik.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment