Fix Docker volume permissions for backend runtime

This commit is contained in:
Ryan Lancaster
2026-03-17 14:08:46 -04:00
parent ca46302aff
commit 7cd0005cba
4 changed files with 337 additions and 3 deletions

View File

@@ -5,16 +5,18 @@ ENV NODE_ENV=production
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN apk add --no-cache curl && npm install --omit=dev RUN apk add --no-cache curl su-exec && npm install --omit=dev
COPY . . COPY . .
RUN chown -R node:node /app RUN chown -R node:node /app
USER node COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 4000 EXPOSE 4000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl -f http://localhost:4000/health || exit 1 CMD curl -f http://localhost:4000/health || exit 1
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "index.js"] CMD ["node", "index.js"]

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -eu
mkdir -p /app/data /app/uploads
chown -R node:node /app/data /app/uploads
exec su-exec node "$@"

325
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -32,6 +32,8 @@
"afterSign": "scripts/adhoc-sign.js" "afterSign": "scripts/adhoc-sign.js"
}, },
"dependencies": { "dependencies": {
},
"devDependencies": {
"electron": "^30.0.0", "electron": "^30.0.0",
"electron-builder": "^24.0.0" "electron-builder": "^24.0.0"
} }