-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (35 loc) · 1.04 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
# syntax=docker/dockerfile:1
# using alpine base image to avoid `sharp` memory leaks.
# @see https://sharp.pixelplumbing.com/install#linux-memory-allocator
# build
FROM node:22-alpine AS build
RUN corepack enable
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
USER node
COPY --chown=node:node .npmrc package.json pnpm-lock.yaml ./
RUN pnpm fetch
COPY --chown=node:node ./ ./
ARG NUXT_PUBLIC_APP_BASE_URL
ARG NUXT_PUBLIC_BOTS
ARG NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION
ARG NUXT_PUBLIC_MATOMO_BASE_URL
ARG NUXT_PUBLIC_MATOMO_ID
ARG NUXT_PUBLIC_REDMINE_ID
ARG NUXT_PUBLIC_TYPESENSE_API_KEY
ARG NUXT_PUBLIC_TYPESENSE_COLLECTION_PREFIX
ARG NUXT_PUBLIC_TYPESENSE_HOST
ARG NUXT_PUBLIC_TYPESENSE_PORT
ARG NUXT_PUBLIC_TYPESENSE_PROTOCOL
RUN pnpm install --frozen-lockfile --offline
ENV NODE_ENV=production
RUN pnpm run build
# serve
FROM node:22-alpine AS serve
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
USER node
COPY --from=build --chown=node:node /app/.output ./
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "./server/index.mjs"]