-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
33 lines (26 loc) · 1.25 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
# build stage
FROM docker.io/node:22 AS build-stage
## add libraries needed for installing canvas npm package
RUN apt update && apt install -y g++ libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev;
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY babel.config.js eslint.config.js LICENSE.md .prettierrc.js tsconfig.json tsconfig.build.json .prettierignore ./
COPY lib/eslint-plugin-schulcloud ./lib/eslint-plugin-schulcloud
COPY public ./public
COPY src ./src
COPY config/webpack ./config/webpack
ARG SC_THEME=default
ENV SC_THEME ${SC_THEME}
RUN NODE_ENV=production npm run build
COPY .git ./.git
RUN echo "{\"sha\": \"$(git rev-parse HEAD)\", \"version\": \"$(git describe --tags --abbrev=0)\", \"commitDate\": \"$(git log -1 --format=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ')\", \"birthdate\": \"$(date +%Y-%m-%dT%H:%M:%SZ)\"}" > ./dist/nuxtversion
# run stage
FROM docker.io/nginx:1.27
RUN mkdir /etc/nginx/templates
COPY config/docker/nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build-stage /app/dist /usr/share/nginx/html/frontend
# second index.html needed for the location /h5p/ in csp rules
COPY --from=build-stage /app/dist /usr/share/nginx/html/h5p
EXPOSE 4000
CMD ["nginx", "-g", "daemon off;"]