-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 806 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 806 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
# syntax=docker/dockerfile:1
FROM node:24-bookworm-slim AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 make g++ \
&& npm install --omit=dev --no-audit --no-fund \
&& apt-get purge -y --auto-remove python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
FROM node:24-bookworm-slim
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends tzdata git ca-certificates \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
COPY --from=deps /app/node_modules ./node_modules
COPY package.json ./
COPY . .
ENV NODE_ENV=production
ENV PORT=3000
ENV TZ=Asia/Shanghai
EXPOSE 3000
CMD ["node", "src/index.js"]