-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (39 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
56 lines (39 loc) · 1.18 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
ARG NODE_VERSION="24.12"
ARG ALPINE_VERSION="3.23"
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS base
WORKDIR /usr/src/app
# Expose Next.js port
EXPOSE 3000
# Disable Next.js telemetry
ENV NEXT_TELEMETRY_DISABLED=1
# Install node packages
COPY package*.json ./
RUN npm ci
# Generate prisma client
RUN mkdir -p src/prisma
COPY src/prisma/schema src/prisma/schema
COPY prisma.config.ts .
RUN npx prisma generate
COPY src/prisma/owSchema src/prisma/owSchema
RUN npm run dobbelOmega:generate
RUN mkdir -p usr/src/app/store/images
# Copy remaining files except src
# (src is binded in dev so there is no need to copy it here)
COPY public public
COPY next-env.d.t[s] next.config.ts tsconfig.json ./
############################################################
FROM base AS prod
ENV NODE_ENV=production
COPY src src
RUN npm run build
CMD ["npm", "run", "start"]
############################################################
FROM base AS test
ENV NODE_ENV=test
COPY jest.config.ts ./
# src and tests are expected to be binded in test
CMD ["npm", "run", "test"]
############################################################
FROM base AS dev
ENV NODE_ENV=development
CMD ["npm", "run", "dev-seed"]