-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.blifrivillig
60 lines (44 loc) · 1.96 KB
/
Dockerfile.blifrivillig
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
59
60
# Install dependencies only when needed
FROM node:lts-alpine AS Sourcer
WORKDIR /app
COPY . .
RUN apk add --no-cache libc6-compat
RUN npm install --global turbo
RUN npm run prune:blifrivillig
FROM node:lts-alpine AS Builder
WORKDIR /app
COPY --from=Sourcer /app/out .
# # Mount=type=secret is only accessible in the same RUN command
# RUN --mount=type=secret,id=CMS_TOKEN,required=true \
# --mount=type=secret,id=STUDENTBERGEN_TOKEN,required=true \
# --mount=type=secret,id=CRESCAT_TOKEN,required=true \
# --mount=type=secret,id=INVALIDATE_SECRET \
# export CMS_TOKEN=$(cat /run/secrets/CMS_TOKEN) && \
# export STUDENTBERGEN_TOKEN=$(cat /run/secrets/STUDENTBERGEN_TOKEN) && \
# export CRESCAT_TOKEN=$(cat /run/secrets/CRESCAT_TOKEN) && \
# export INVALIDATE_SECRET=$(cat /run/secrets/INVALIDATE_SECRET)
ARG CMS_TOKEN
ARG STUDENTBERGEN_TOKEN
ARG CRESCAT_TOKEN
ARG INVALIDATE_SECRET
RUN npm install --unsafe-perm
RUN npm run postbuild
FROM node:lts-alpine AS Runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=Builder /app/package.json /app/package-lock.json ./
COPY --from=Builder /app/node_modules ./node_modules
COPY --from=Builder /app/apps/blifrivillig/package.json ./apps/blifrivillig/package.json
COPY --from=Builder /app/apps/blifrivillig/public ./apps/blifrivillig/public
COPY --from=Builder /app/apps/blifrivillig/.next ./apps/blifrivillig/.next
COPY --from=Builder /app/apps/blifrivillig/next.config.js ./apps/blifrivillig/next.config.js
COPY --from=Builder /app/apps/blifrivillig/next-sitemap.js ./apps/blifrivillig/next-sitemap.js
COPY --from=Builder /app/packages ./packages
EXPOSE 3000
ENV PORT 3000
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry.
# ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /app/apps/blifrivillig
CMD ["../../node_modules/.bin/next", "start"]