Dockerfile never received DASHCADDY_COMMIT at build, so /app/VERSION held
'unknown'. _isNewer then treated same-version-different-commit as newer,
making the auto-updater rebuild the container indefinitely (each rebuild
still produced commit='unknown').
- self-updater._isNewer: normalize commits; treat unknown/null/empty as no
commit info and fall back to pure version comparison
- self-updater._autoCheckAndApply + routes/updates: refuse to apply when
local version >= remote version (belt-and-suspenders)
- update-management.js: hide '(unknown)' from version label
- Dockerfile: COPY VERSION instead of writing from build arg
- VERSION: committed placeholder ('dev'); scripts/release.sh now writes
the real short SHA into the tarball's VERSION before tar-ing, so every
published release ships with an accurate commit
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
925 B
Docker
32 lines
925 B
Docker
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Install OpenSSL for certificate generation
|
|
RUN apk add --no-cache openssl
|
|
|
|
COPY package*.json ./
|
|
RUN npm install --production
|
|
|
|
COPY *.js ./
|
|
COPY src/ ./src/
|
|
COPY routes/ ./routes/
|
|
COPY openapi.yaml ./
|
|
|
|
# VERSION file holds the short git SHA the image was built from. Committed as
|
|
# 'dev' for source builds; the release script (scripts/release.sh) overwrites it
|
|
# with the actual commit hash before tarballing each release.
|
|
COPY VERSION ./
|
|
|
|
# Note: Running as root because container needs Docker socket access
|
|
# (which is root-equivalent anyway). Socket access required for container management.
|
|
|
|
EXPOSE 3001
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD node -e "require('http').get('http://localhost:3001/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1))"
|
|
|
|
CMD ["node", "server.js"]
|