aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Containerfile6
-rw-r--r--Makefile6
-rwxr-xr-xclone-generate-and-serve.sh11
3 files changed, 19 insertions, 4 deletions
diff --git a/Containerfile b/Containerfile
index 4eec831..71a3c5c 100644
--- a/Containerfile
+++ b/Containerfile
@@ -1,5 +1,7 @@
FROM alpine:3
RUN apk add --no-cache git hugo nginx
COPY clone-generate-and-serve.sh /bin/clone-generate-and-serve.sh
-ENTRYPOINT ["/bin/clone-generate-and-serve.sh"]
-
+COPY nginx.conf /etc/nginx/http.d/default.conf
+EXPOSE 80
+STOPSIGNAL SIGQUIT
+CMD ["/bin/clone-generate-and-serve.sh"]
diff --git a/Makefile b/Makefile
index d996f14..5871bbb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,6 @@
build:
- podman build -t capotej-site . \ No newline at end of file
+ podman build -t capotej-site .
+run:
+ podman run -it -p 8181:80 localhost/capotej-site:latest
+debug:
+ podman run -it -p 8181:80 localhost/capotej-site:latest /bin/sh
diff --git a/clone-generate-and-serve.sh b/clone-generate-and-serve.sh
index 674a627..6031ba4 100755
--- a/clone-generate-and-serve.sh
+++ b/clone-generate-and-serve.sh
@@ -1,5 +1,14 @@
#!/bin/sh
+set -eux
+
git clone https://git.capotej.com/capotej/capotej.com.git
-cd capotej.com && hugo \ No newline at end of file
+cd capotej.com || exit 1
+
+git submodule init
+git submodule update
+
+hugo -v -d /usr/share/nginx/html
+
+nginx -g "daemon off;"