Skip to content

Instantly share code, notes, and snippets.

@NorikDavtian
Last active September 3, 2024 04:01
Show Gist options
  • Save NorikDavtian/52e7e15dafeb806e2cd8b077d6223ec8 to your computer and use it in GitHub Desktop.
Save NorikDavtian/52e7e15dafeb806e2cd8b077d6223ec8 to your computer and use it in GitHub Desktop.
Static site dockerfile for static site with busybox minimal httpd server
FROM alpine
ADD . /app/
WORKDIR /app
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