From 2b228b3f6de26a3c8b8a8adb2db516fba7b023c5 Mon Sep 17 00:00:00 2001 From: robin Date: Tue, 5 Dec 2023 16:52:30 +0000 Subject: [PATCH] lighthouse --- .gitea/workflows/deploy.yaml | 8 ++++---- liveserver-dockerfile | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 liveserver-dockerfile diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 7e8306d..924860d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -33,6 +33,10 @@ jobs: SECURITY_ALLOWUPPERPATHS: "true" SECURITY_ALLOWRELATIVEPATHS: "true" + live-server: + image: liveserver-dockerfile + ports: + - 8080:8080 steps: - uses: actions/checkout@v3 with: @@ -51,10 +55,6 @@ jobs: npm install -g yarn yarn install - - name: Start Live Server - run: | - docker run -d -p 8080:8080 -v ${{ github.workspace }}:/usr/src/app gitbase.de/robin/live-server - - name: modify config run: | sed -i 's#\(sentryEnvironment.*\)".*"#\1"${GITHUB_REF_NAME}"#g' frontend/src/config.ts diff --git a/liveserver-dockerfile b/liveserver-dockerfile new file mode 100644 index 0000000..0778d46 --- /dev/null +++ b/liveserver-dockerfile @@ -0,0 +1,21 @@ +# Use an official Node runtime as a parent image +FROM node:20 + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy the package.json and yarn.lock (or package-lock.json) +COPY package*.json ./ +COPY yarn.lock ./ + +# Install any needed packages specified in package.json +RUN yarn install + +# Bundle your app's source code inside the Docker container +COPY . . + +# Your app binds to port 80 so you'll use the EXPOSE instruction to have it mapped by the docker daemon +EXPOSE 80 + +# Define the command to run your app using CMD which defines your runtime +CMD ["yarn", "run", "--", "live-server", "--no-browser", "--port=80", "--ignore='*'", "--entry-file=spa.html", "--no-css-inject", "--proxy=/api:http://tibi-server:8080/api/v1/_/einfo_test", "frontend"] \ No newline at end of file