From 835b7dd65d407ef356bff95c6f9a767c415af083 Mon Sep 17 00:00:00 2001 From: lablans Date: Tue, 19 Dec 2023 16:29:13 +0000 Subject: [PATCH 1/4] Don't rely on foreign image --- Dockerfile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf51699..e17d31d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,16 @@ -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:stable + +# 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"] From d77766b734e035992fe842363fb28b2547a65061 Mon Sep 17 00:00:00 2001 From: lablans Date: Tue, 19 Dec 2023 16:31:16 +0000 Subject: [PATCH 2/4] Fix slow container shutdown --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index e17d31d..9267a13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,3 +14,6 @@ COPY index.html . # Run BusyBox httpd CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"] + +# Fix slow container shutdown +STOPSIGNAL SIGKILL \ No newline at end of file From ea10c450817c0dcc006866150c72531f1a591d0e Mon Sep 17 00:00:00 2001 From: lablans Date: Tue, 19 Dec 2023 16:31:31 +0000 Subject: [PATCH 3/4] .dockerignore not required anymore --- .dockerignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7a87703..2d2ecd6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1 @@ .git/ -.github/ -Dockerfile -*.Dockerfile -README.md -LICENSE From 32fdc2db15502d66691a4802ed14f058132ef303 Mon Sep 17 00:00:00 2001 From: lablans Date: Tue, 19 Dec 2023 16:34:22 +0000 Subject: [PATCH 4/4] Set busybox version number --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9267a13..990ad82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # This is inspired by https://lipanski.com/posts/smallest-docker-image-static-website # but without relying on an external Docker image -FROM busybox:stable +FROM busybox:1 # Create a non-root user to own the files and run our server RUN adduser -D static