From ad1fc85a10338fc2f518144489a5b08ab2ff7ce9 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Fri, 13 Feb 2026 12:16:33 +0100 Subject: [PATCH] feat: docker build and gitea workflow --- .gitea/workflows/build.yml | 30 +++++++++++++++ .github/workflows/ci.yml | 34 ----------------- Dockerfile | 19 ++++++++++ README.md | 76 +------------------------------------- docker-compose.yml | 18 +++++++++ 5 files changed, 68 insertions(+), 109 deletions(-) create mode 100644 .gitea/workflows/build.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..5ac854c --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - beta + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.pihkaal.me + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push Docker image + run: | + docker build -t git.pihkaal.me/pihkaal/pihkaal-me:latest . + docker push git.pihkaal.me/pihkaal/pihkaal-me:latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d43b00b..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: - push: - branches: [main, 3d-nds] - pull_request: - branches: [main, 3d-nds] - -jobs: - ci: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: pnpm setup - uses: pnpm/action-setup@v4 - with: - version: 10 - - - name: node setup - uses: actions/setup-node@v4 - with: - node-version: 25 - cache: "pnpm" - - - name: install - run: pnpm install --frozen-lockfile - - - name: lint - run: pnpm lint - - - name: build - run: pnpm build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b94e9bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:22-alpine AS base +RUN corepack enable + +FROM base AS deps +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +FROM base AS build +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN pnpm build + +FROM base AS runtime +WORKDIR /app +COPY --from=build /app/.output ./.output +EXPOSE 3000 +CMD ["node", ".output/server/index.mjs"] diff --git a/README.md b/README.md index 25b5821..07f1062 100644 --- a/README.md +++ b/README.md @@ -1,75 +1 @@ -# Nuxt Minimal Starter - -Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. - -## Setup - -Make sure to install dependencies: - -```bash -# npm -npm install - -# pnpm -pnpm install - -# yarn -yarn install - -# bun -bun install -``` - -## Development Server - -Start the development server on `http://localhost:3000`: - -```bash -# npm -npm run dev - -# pnpm -pnpm dev - -# yarn -yarn dev - -# bun -bun run dev -``` - -## Production - -Build the application for production: - -```bash -# npm -npm run build - -# pnpm -pnpm build - -# yarn -yarn build - -# bun -bun run build -``` - -Locally preview production build: - -```bash -# npm -npm run preview - -# pnpm -pnpm preview - -# yarn -yarn preview - -# bun -bun run preview -``` - -Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. +# beta.pihkaal.me diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..743bd1d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + app: + image: git.pihkaal.me/pihkaal/pihkaal-me:latest + restart: unless-stopped + networks: + - web + labels: + - "traefik.enable=true" + - "traefik.http.routers.pihkaal-me.rule=Host(`beta.pihkaal.me`)" + - "traefik.http.routers.pihkaal-me.middlewares=auth" + - "traefik.http.routers.pihkaal-me.tls=true" + - "traefik.http.routers.pihkaal-me.tls.certResolver=myresolver" + - "traefik.http.services.pihkaal-me.loadbalancer.server.port=3000" + - "traefik.http.middlewares.auth.basicauth.users=${BASIC_AUTH_USERS}" + +networks: + web: + external: true