Added FLATNOTES_PORT env var
authorAdam Dullage <redacted>
Fri, 19 Apr 2024 11:58:39 +0000 (12:58 +0100)
committerAdam Dullage <redacted>
Fri, 19 Apr 2024 11:58:39 +0000 (12:58 +0100)
.dockerignore
Dockerfile
entrypoint.sh
healthcheck.sh [new file with mode: 0644]

index 2740fa7249945af04073757d4950bc9d38d8dbe8..ef36c2881fdd11cbbc8e73014659848aa05cf93d 100644 (file)
@@ -2,13 +2,14 @@
 **
 
 # Include the following
+!.htmlnanorc
 !LICENSE
 !Pipfile
 !Pipfile.lock
-!package.json
-!package-lock.json
 !client/**
-!server/**
 !entrypoint.sh
-!.htmlnanorc
+!healthcheck.sh
+!package-lock.json
+!package.json
+!server/**
 !vite.config.js
index 84a54cb75356fa138642531331f65726e6661e52..c3447eb1d12d4038e5a4c953bd8368d2a7ebaed2 100644 (file)
@@ -22,6 +22,7 @@ ARG BUILD_DIR
 ENV PUID=1000
 ENV PGID=1000
 ENV EXEC_TOOL=gosu
+ENV FLATNOTES_PORT=8080
 
 ENV APP_PATH=/app
 ENV FLATNOTES_PATH=/data
@@ -45,10 +46,11 @@ RUN pipenv install --deploy --ignore-pipfile --system && \
 COPY server ./server
 COPY --from=build ${BUILD_DIR}/client/dist ./client/dist
 
+COPY entrypoint.sh healthcheck.sh /
+RUN chmod +x /entrypoint.sh /healthcheck.sh
+
 VOLUME /data
-EXPOSE 8080/tcp
-HEALTHCHECK --interval=60s --timeout=10s CMD curl -f http://localhost:8080/health || exit 1
+EXPOSE ${FLATNOTES_PORT}/tcp
+HEALTHCHECK --interval=60s --timeout=10s CMD /healthcheck.sh
 
-COPY entrypoint.sh /
-RUN chmod +x /entrypoint.sh
 ENTRYPOINT [ "/entrypoint.sh" ]
index d9fbf3c628944389d2e7bd4a6b3737c2a047a2fc..737990c8bfee0137ff28fa4141981a6e5839ca88 100644 (file)
@@ -22,7 +22,7 @@ flatnotes_command="python -m \
                   main:app \
                   --app-dir server \
                   --host 0.0.0.0 \
-                  --port 8080 \
+                  --port ${FLATNOTES_PORT} \
                   --proxy-headers \
                   --forwarded-allow-ips '*'"
 
@@ -32,7 +32,7 @@ if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then
 
     echo Starting flatnotes as user ${PUID}...
     exec ${EXEC_TOOL} ${PUID}:${PGID} ${flatnotes_command}
-      
+
 else
     echo "A user was set by docker, skipping file permission changes."
     echo Starting flatnotes as user $(id -u)...
diff --git a/healthcheck.sh b/healthcheck.sh
new file mode 100644 (file)
index 0000000..8d01824
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+curl -f http://localhost:${FLATNOTES_PORT}/health || exit 1
git clone https://git.99rst.org/PROJECT