forked from eclipse-mnestix/mnestix-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (44 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
58 lines (44 loc) · 1.47 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
FROM node:22-alpine AS base
RUN apk update && apk add --no-cache openssl
FROM base AS deps
WORKDIR /app
COPY package*.json yarn.lock* ./
RUN apk add --no-cache python3 py-setuptools make g++
# network-timeout is a workaround for yarn QEMU support
# https://github.com/docker/build-push-action/issues/471
# https://github.com/nodejs/docker-node/issues/1335
RUN yarn install --frozen-lockfile --network-timeout 1000000
# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry
# Comment the following line to enable telemetry at run time
ENV NEXT_TELEMETRY_DISABLED=1
FROM deps AS builder
WORKDIR /app
COPY . .
# Run initial database setup: apply migrations and generate Prisma client
RUN yarn prisma migrate deploy
RUN yarn prisma generate
ENV NO_TYPECHECK=1
ENV NO_LINT=1
RUN yarn build
FROM base AS production
WORKDIR /app
ENV NODE_ENV=production
RUN yarn add prisma
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
USER nextjs
EXPOSE 3000
ENV PORT=3000
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --from=builder --chown=nextjs:nodejs /app/dist/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/dist/static ./public/_next/static
COPY ./scripts scripts
ENTRYPOINT [ "/bin/sh" ]
CMD [ "/app/scripts/start.sh" ]
FROM deps AS dev
ENV NODE_ENV=development
COPY . .
RUN yarn prisma migrate deploy
RUN yarn prisma generate
CMD [ "yarn", "dev"]