Skip to content

Commit

Permalink
Merge pull request #1 from samply/robustify
Browse files Browse the repository at this point in the history
Don't rely on foreign image
  • Loading branch information
TKussel authored Dec 19, 2023
2 parents c8bbbbe + 32fdc2d commit 7844697
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
.git/
.github/
Dockerfile
*.Dockerfile
README.md
LICENSE
21 changes: 18 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
FROM lipanski/docker-static-website:latest
# This is inspired by https://lipanski.com/posts/smallest-docker-image-static-website
# but without relying on an external Docker image

# Copy your static files
COPY . .
FROM busybox:1

# 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 index.html .

# Run BusyBox httpd
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"]

# Fix slow container shutdown
STOPSIGNAL SIGKILL

0 comments on commit 7844697

Please sign in to comment.