-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
67 lines (48 loc) · 1.35 KB
/
Dockerfile
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
66
67
FROM node:22.9.0-alpine AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI="true"
ARG NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL
ARG NUXT_PUBLIC_DEFAULT_LOCALE
ARG NUXT_SITE_URL
ARG NUXT_SITE_NAME
ARG NUXT_SITE_ENV
ARG NUXT_SITE_DESCRIPTION
RUN corepack enable
USER node
WORKDIR /app
COPY --chown=node:node package.json ./
COPY --chown=node:node nuxt.config.ts ./
COPY --chown=node:node app ./app
COPY --chown=node:node config ./config
COPY --chown=node:node modules ./modules
COPY --chown=node:node server ./server
COPY --chown=node:node public ./public
COPY --chown=node:node pnpm-lock.yaml ./
COPY --chown=node:node tsconfig.json ./
RUN pnpm install
RUN npm run build
RUN pnpm prune --prod
FROM node:22.9.0-alpine AS production
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI="true"
ARG NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL
ARG NUXT_PUBLIC_DEFAULT_LOCALE
ARG NUXT_SITE_URL
ARG NUXT_SITE_NAME
ARG NUXT_SITE_ENV
ARG NUXT_SITE_DESCRIPTION
RUN corepack enable
USER node
ENV NODE_ENV=production
WORKDIR /app
COPY --from=build /app/package.json ./
COPY --from=build /app/pnpm-lock.yaml ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/.nuxt ./.nuxt
COPY --from=build /app/.output ./.output
COPY --from=build /app/public ./public
COPY --from=build /app/server ./server
EXPOSE 3000
CMD ["pnpm", "start"]