Files
relay/server/Dockerfile
2025-01-05 00:24:28 +01:00

24 lines
548 B
Docker

ARG NODE_VERSION=20.17.0
FROM node:${NODE_VERSION}-alpine
WORKDIR /usr/src/app
# Create the attachments directory and set permissions
RUN mkdir -p attachments && chown -R node:node attachments
# Install dependencies
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
# Switch to the node user
USER node
# Copy the application code
COPY --chown=node:node . .
EXPOSE 3000
CMD node server.js