-
-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 826 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Use Debian slim for more reliable multi-arch builds under emulation
FROM node:24-bookworm-slim
# Set working directory
WORKDIR /src
# Set environment variables
ENV NODE_ENV="production"
# Copy package*.json and .env dependencies
COPY package*.json ./
COPY .env.template ./.env
# Install necessary system packages and dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
vim \
&& npm ci --omit=dev --silent \
&& npm cache clean --force \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Copy the application code
COPY frontend frontend
COPY backend backend
# Run as the non-root "node" user (uid/gid 1000) shipped with the base image
RUN chown -R node:node /src
USER node
# Set default command to start the application
CMD ["npm", "start"]