mirror of
https://github.com/mailvelope/keyserver.git
synced 2026-10-24 08:19:18 +03:00
- Update Node.js version from 18 to 22 (matching engines >= 20) - Add required BASE_URL to env.sample and README Docker section - Remove obsolete HTTPS_UPGRADE/HTTPS_KEY_PIN settings from env.sample - Rename PAPERTRAIL_HOST/PORT to SYSLOG_HOST/PORT in env.sample - Update GitHub Actions checkout from v2 to v4 - Exclude MongoDB shell script mongo-init.js from ESLint
32 lines
881 B
Docker
32 lines
881 B
Docker
# syntax=docker/dockerfile:1
|
|
ARG NODE_VERSION=22
|
|
|
|
FROM node:${NODE_VERSION}-alpine
|
|
|
|
# Use production node environment by default.
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
# Download dependencies as a separate step to take advantage of Docker's caching.
|
|
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
|
|
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
|
|
# into this layer.
|
|
RUN --mount=type=bind,source=package.json,target=package.json \
|
|
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
|
--mount=type=cache,target=/root/.npm \
|
|
npm ci --omit=dev
|
|
|
|
# Run the application as a non-root user.
|
|
USER node
|
|
|
|
# Copy the rest of the source files into the image.
|
|
COPY . .
|
|
|
|
# Expose the port that the application listens on.
|
|
EXPOSE 3000
|
|
|
|
# Run the application.
|
|
CMD ["node", "src/index.js"]
|