added a Dockerfile and gitlab-ci config

This commit is contained in:
Micha Gläß-Stöcker 2021-08-23 20:30:31 +02:00
parent 427ea588aa
commit 7fb882b61d
3 changed files with 48 additions and 0 deletions

24
Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM node:lts-alpine as build
ARG HOMEPAGE="/"
ARG ASU_URL="https://chef.libremesh.org"
WORKDIR /usr/src/app
COPY . .
RUN cat src/config.ts
RUN sed -i "s#asu_url: 'https://chef.libremesh.org'#asu_url: '$ASU_URL'#g" src/config.ts
RUN cat src/config.ts
# quick hack to get the multiarch builds running
RUN yarn add @material-ui/icons
# make the homepage config var configurable on buildtime via docker build-arg
RUN yarn add json
RUN node_modules/.bin/json -I -f package.json -e "this.homepage='$HOMEPAGE'"
RUN yarn install
RUN yarn build
FROM nginx:stable-alpine AS release
COPY --from=build /usr/src/app/build /usr/share/nginx/html