forked from neuland-ingolstadt/neuland.app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (31 loc) · 1.3 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
FROM alekzonder/puppeteer:latest AS pwaicons
USER root
WORKDIR /opt/
COPY rogue-thi-app/public/favicon.svg .
RUN mkdir ./splash && npx pwa-asset-generator --no-sandbox=true --path-override '/' --xhtml --dark-mode favicon.svg ./splash/
RUN export NEXT_PUBLIC_COMMIT_HASH=$(git rev-parse HEAD)
ENV NEXT_PUBLIC_COMMIT_HASH=$NEXT_PUBLIC_COMMIT_HASH
FROM node:21
WORKDIR /opt/next
ARG NEXT_PUBLIC_HACKERMAN_FLAGS
ARG NEXT_PUBLIC_GUEST_ONLY
ARG NEXT_PUBLIC_THI_API_MODE
ARG NEXT_PUBLIC_THI_API_KEY
ARG NEXT_PUBLIC_NEULAND_GRAPHQL_ENDPOINT
ENV NEXT_PUBLIC_HACKERMAN_FLAGS $NEXT_PUBLIC_HACKERMAN_FLAGS
ENV NEXT_PUBLIC_GUEST_ONLY $NEXT_PUBLIC_GUEST_ONLY
ENV NEXT_PUBLIC_THI_API_MODE $NEXT_PUBLIC_THI_API_MODE
ENV NEXT_PUBLIC_THI_API_KEY $NEXT_PUBLIC_THI_API_KEY
ENV NEXT_PUBLIC_NEULAND_GRAPHQL_ENDPOINT $NEXT_PUBLIC_NEULAND_GRAPHQL_ENDPOINT
COPY rogue-thi-app/package.json rogue-thi-app/package-lock.json ./
RUN npm install
COPY rogue-thi-app/ .
COPY --from=pwaicons /opt/splash/ public/
RUN curl --output-dir data/ https://assets.neuland.app/generated/spo-grade-weights.json
RUN curl --output-dir data/ https://assets.neuland.app/generated/room-distances.json
RUN curl --output-dir data/ https://assets.neuland.app/generated/ical-courses.json
RUN npm run build
ENV NODE_ENV=production
USER node
EXPOSE 3000
CMD ["npm", "start"]