forked from thejohnfreeman/redirectory
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (33 loc) · 1.08 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (33 loc) · 1.08 KB
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
FROM node:24-bookworm-slim AS base
FROM base AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM build AS check
COPY tests ./tests
COPY scripts ./scripts
COPY .env.example ./
RUN node --test tests/*.test.mjs
FROM base AS e2e-tools
USER root
RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-venv g++ cmake make ca-certificates && rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/conan && /opt/conan/bin/pip install --no-cache-dir conan==2.32.0
RUN python3 -m venv /opt/conan1 && /opt/conan1/bin/pip install --no-cache-dir conan==1.66.0
ENV PATH="/opt/conan/bin:${PATH}"
FROM e2e-tools AS e2e
WORKDIR /app
COPY --from=check /app /app
CMD ["node", "tests/mock-server.mjs"]
FROM base AS runtime
ENV NODE_ENV=production PORT=9595
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
COPY --from=build /app/dist ./dist
COPY scripts/container.mjs ./scripts/
USER node
EXPOSE 9595
CMD ["node", "dist/serve.js"]