Skip to content

Build your personal knowledge base with Trilium Notes

fix docker file permissions so 777 is no longer needed

dousha942f17b2f436
diff --git a/Dockerfile b/Dockerfile
index 7f03916de3..0687992b70 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,13 +18,19 @@ RUN set -x \
nasm \
libpng-dev \
python3 \
+ wget \
&& npm install --production \
&& apk del .build-dependencies
+# Some setup tools need to be kept
+RUN apk add --no-cache su-exec
+
# Bundle app source
COPY . .
-USER node
+# Add application user and setup proper volume permissions
+RUN adduser -s /bin/false node; exit 0
+# Start the application
EXPOSE 8080
-CMD [ "node", "./src/www" ]
+CMD [ "./start-docker.sh" ]
diff --git a/start-docker.sh b/start-docker.sh
new file mode 100755
index 0000000000..e214560ea1
--- /dev/null
+++ b/start-docker.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+chown -R node:node /home/node
+su-exec node node ./src/www