generated from acdh-oeaw/template-app-nuxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (28 loc) · 814 Bytes
/
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
# syntax=docker/dockerfile:1
# build
FROM node:20-slim 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 nuxt.config.ts tailwind.config.ts tsconfig.json ./
COPY --chown=node:node public ./public
COPY --chown=node:node src ./src
ARG NUXT_PUBLIC_APP_BASE_URL
ARG NUXT_PUBLIC_REDMINE_ID
ARG NUXT_PUBLIC_MATOMO_BASE_URL
ARG NUXT_PUBLIC_MATOMO_ID
RUN pnpm install --frozen-lockfile --offline
ENV NODE_ENV=production
RUN pnpm run build
# serve
FROM node:20-slim 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"]