From 2de8609d3ce379879ca81fbd35c67cf9566353af Mon Sep 17 00:00:00 2001 From: robgit21 Date: Sun, 10 May 2026 12:14:10 +0200 Subject: [PATCH] =?UTF-8?q?Dockerfile=20+=20CI/CD=20Pipeline=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yaml | 20 ++++++++++++++++++++ .npmrc | 1 + Dockerfile | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml create mode 100644 .npmrc create mode 100644 Dockerfile diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..d53e6c0 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,20 @@ +name: Deploy Portfolio +on: + push: + branches: [ "master" ] + +jobs: + deploy: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build and Deploy + run: | + docker build -t portfolio:latest . + docker stop portfolio 2>/dev/null || true + docker rm portfolio 2>/dev/null || true + docker run -d --name portfolio -p 8081:80 portfolio:latest diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..83cff3c --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +pnpm.onlyBuiltDependencies=* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d4c2501 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:22-alpine AS build +WORKDIR /app +COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./ +COPY apps/web/package.json apps/web/ +RUN npm install -g pnpm && pnpm install --no-frozen-lockfile +COPY apps/web/ apps/web/ +WORKDIR /app/apps/web +RUN pnpm run build + +FROM nginx:stable-alpine +COPY --from=build /app/apps/web/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"]