This commit is contained in:
39
.gitea/workflows/docker-build.yaml
Normal file
39
.gitea/workflows/docker-build.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
if: env.REGISTRY != '' && env.REGISTRY_USER != '' && env.REGISTRY_PASSWORD != ''
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ env.REGISTRY != '' }}
|
||||||
|
tags: ${{ env.REGISTRY }}/vitrify-me:${{ github.sha }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.REGISTRY }}
|
||||||
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# cat Dockerfile
|
||||||
|
# Stage 1: Builder
|
||||||
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install pnpm
|
||||||
|
RUN npm install -g pnpm@9.0.0
|
||||||
|
|
||||||
|
# Copy files
|
||||||
|
COPY pnpm-lock.yaml ./
|
||||||
|
COPY package.json ./
|
||||||
|
COPY turbo.json ./
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install deps and build
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
# Stage 2: Runtime
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /app ./
|
||||||
|
|
||||||
|
CMD ["node", "apps/web/server.js"]
|
||||||
|
|
||||||
Reference in New Issue
Block a user