-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from samply/robustify
Don't rely on foreign image
- Loading branch information
Showing
2 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
.git/ | ||
.github/ | ||
Dockerfile | ||
*.Dockerfile | ||
README.md | ||
LICENSE |
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
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 |