-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
50 lines (46 loc) · 1.36 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
FROM node:22-alpine AS builder
ENV NODE_ENV production
ENV APP_ENV production
# Used to build the project
RUN mkdir app
WORKDIR /app
COPY components components
COPY Modules Modules
COPY pages pages
COPY public public
COPY scripts scripts
COPY styles styles
COPY eslint.config.mjs eslint.config.mjs
COPY next.config.js next.config.js
COPY package-lock.json package-lock.json
COPY package.json package.json
COPY tsconfig.json tsconfig.json
COPY tsconfig2.json tsconfig2.json
COPY types types
COPY locales locales
ENV SQLITE=/app/temp.db
RUN npm run build
RUN rm /app/temp.db
RUN rm -rf /app/scripts/data
RUN rm /app/scripts/data.ts
FROM node:22-alpine
ENV NODE_ENV production
ENV APP_ENV production
# Used to run the project
RUN mkdir app
WORKDIR /app
COPY --from=builder /app/.next /app/.next
COPY --from=builder /app/Modules /app/Modules
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/public /app/public
COPY --from=builder /app/scripts /app/scripts
COPY --from=builder /app/types /app/types
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/next.config.js /app/next.config.js
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/tsconfig2.json /app/tsconfig2.json
ENV NEXTAUTH_URL_INTERNAL=http://127.0.0.1:3000
RUN touch /app/revalidate
EXPOSE 3000
ENV PORT 3000
CMD npm run start:no-build