-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (33 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
39 lines (33 loc) · 854 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
33
34
35
36
37
38
39
FROM node:24-alpine AS base
# ----------------------------
# Stage 1: Install all dependencies
# ----------------------------
FROM base AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
# ----------------------------
# Stage 2: Build the application
# ----------------------------
FROM deps AS build
WORKDIR /app
ENV NODE_ENV=development
COPY . .
RUN cp .env.example .env \
&& node ace generate:key \
&& node ace docs:generate \
&& node ace build
# ----------------------------
# Stage 3: Production runtime
# ----------------------------
FROM base AS production
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/build ./
COPY --from=build /app/swagger.json ./
COPY --from=build /app/swagger.yml ./
RUN npm ci --omit=dev
# Copy the entrypoint script
COPY docker-entrypoint.js ./
EXPOSE 3000
CMD ["node", "docker-entrypoint.js"]