Files
dashcaddy/dashcaddy-api/Dockerfile
T
Hermes 5c02bfba1d
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s
DC-084/085/089/090: Quick wins batch
DC-084: Add .dockerignore (excludes __tests__/, .git/, node_modules/, coverage/)
DC-085: Replace Math.random() with crypto.randomUUID()/crypto.randomBytes() for IDs
DC-089: Add dedicated rate limiter on POST /license/activate (10 attempts/15min)
DC-090: Pin Node.js to 20.11.1-alpine3.19 + add engines field to package.json

All 1539 tests pass. ESLint: 0 errors.
2026-08-12 02:24:28 -07:00

32 lines
934 B
Docker

FROM node:20.11.1-alpine3.19
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"]