-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 730 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 730 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
FROM node:18
# Install required runtimes (JDK + Python3), then clean up apt cache to reduce surface
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
openjdk-17-jdk \
python3 \
ca-certificates; \
rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy dependency manifests first for better caching
COPY package*.json ./
# Install production dependencies
ENV NODE_ENV=production
RUN npm ci --omit=dev || npm install --only=production
# Copy the application code
COPY . .
# Drop root privileges for runtime
USER node
# Expose port
EXPOSE 3000
# Run the app
CMD ["node", "server.js"]