-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (49 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
65 lines (49 loc) · 1.61 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Multi-stage Alpine (même esprit que sesame-orchestrator) : build isolé, runtime avec node_modules complet pour `start.mjs` (rebuild si `.env` change).
FROM node:22-alpine AS builder
WORKDIR /data
RUN apk add --no-cache git
COPY package.json yarn.lock ./
RUN yarn install \
--prefer-offline \
--frozen-lockfile \
--non-interactive \
--production=false
COPY . .
RUN yarn build
FROM node:22-alpine AS production
ARG NODE_ENV=production
ARG BUILD_VERSION=dev
ARG GIT_BRANCH=unknown
ARG GIT_COMMIT=unknown
ARG DOCKER_TAG=unknown
ENV NODE_ENV=${NODE_ENV}
ENV BUILD_VERSION=${BUILD_VERSION}
ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_COMMIT=${GIT_COMMIT}
ENV DOCKER_TAG=${DOCKER_TAG}
ENV DO_NOT_TRACK=1
ENV TZ=Europe/Paris
WORKDIR /data
RUN apk add --no-cache \
git \
openssl \
jq \
bash \
tzdata \
&& cp "/usr/share/zoneinfo/${TZ}" /etc/localtime \
&& echo "${TZ}" > /etc/timezone
COPY package.json yarn.lock ./
# Même jeu de fichiers que le builder : `start.mjs` peut relancer `yarn build` si le hash `.env` change.
COPY --from=builder /data/node_modules ./node_modules
COPY --from=builder /data/.output ./.output
COPY --from=builder /data/start.mjs ./start.mjs
COPY --from=builder /data/nuxt.config.ts ./nuxt.config.ts
COPY --from=builder /data/tsconfig.json ./tsconfig.json
COPY --from=builder /data/src ./src
COPY --from=builder /data/playwright.config.ts ./playwright.config.ts
COPY --from=builder /data/vitest.config.ts ./vitest.config.ts
COPY --from=builder /data/tests ./tests
RUN yarn cache clean \
&& rm -rf /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp
EXPOSE 3000
CMD ["yarn", "run", "start:prod"]