forked from neuland-ingolstadt/neuland.app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (53 loc) · 1.8 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM python:3 AS spo
WORKDIR /opt/
COPY spo-parser/requirements.txt .
RUN apt-get update \
&& apt-get install -y libgl1 ghostscript \
&& pip install -r requirements.txt
ARG NEXT_PUBLIC_GUEST_ONLY
ENV NEXT_PUBLIC_GUEST_ONLY $NEXT_PUBLIC_GUEST_ONLY
COPY spo-parser/ .
RUN ./run_extraction.sh
FROM python:3 AS distances
WORKDIR /opt/
COPY room-distances .
RUN pip install -r requirements.txt \
&& python3 calculate-distances.py
FROM python:3 as courses
WORKDIR /opt/
ARG THI_ICAL_USER
ARG THI_ICAL_SESSION
ENV THI_ICAL_USER $THI_ICAL_USER
ENV THI_ICAL_SESSION $THI_ICAL_SESSION
COPY course-downloader .
RUN pip install -r requirements.txt \
&& python3 obtain_course_list.py
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 --favicon --dark-mode favicon.svg ./splash/
FROM node:18
WORKDIR /opt/next
ARG NEXT_PUBLIC_HACKERMAN_FLAGS
ARG NEXT_PUBLIC_ELECTION_URL
ARG NEXT_PUBLIC_GUEST_ONLY
ARG NEXT_PUBLIC_THI_API_MODE
ARG NEXT_PUBLIC_THI_API_KEY
ENV NEXT_PUBLIC_HACKERMAN_FLAGS $NEXT_PUBLIC_HACKERMAN_FLAGS
ENV NEXT_PUBLIC_ELECTION_URL $NEXT_PUBLIC_ELECTION_URL
ENV NEXT_PUBLIC_GUEST_ONLY $NEXT_PUBLIC_GUEST_ONLY
ARG NEXT_PUBLIC_THI_API_MODE $NEXT_PUBLIC_THI_API_MODE
ENV NEXT_PUBLIC_THI_API_KEY $NEXT_PUBLIC_THI_API_KEY
COPY rogue-thi-app/package.json rogue-thi-app/package-lock.json ./
# OpenSSL legacy provider needed to build node-forge
RUN NODE_OPTIONS=--openssl-legacy-provider npm install
COPY rogue-thi-app/ .
COPY --from=spo /opt/spo-grade-weights.json data/
COPY --from=distances /opt/room-distances.json data/
COPY --from=courses /opt/ical-courses.json data/
COPY --from=pwaicons /opt/splash/ public/
RUN npm run build
USER node
EXPOSE 3000
CMD ["npm", "start"]