chore: add Dockerfile and Gitea Actions build workflow
Build & Push Docker Image / build (push) Failing after 2s

This commit is contained in:
2026-05-10 12:44:47 +02:00
parent 87c09d6780
commit 7c2c3217de
3 changed files with 71 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
node_modules/
dist/
.env
server/data/
.git/
.gitkeep
*.md
.gitignore
docs/
+28
View File
@@ -0,0 +1,28 @@
name: Build & Push Docker Image
run-name: Build ${{ gitea.ref_name }} by @${{ gitea.actor }}
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login Gitea Container Registry
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login gitea.lokcal.de -u loki --password-stdin
- name: Build and tag
run: |
IMAGE="gitea.lokcal.de/loki/update-planer"
docker build \
--label "org.opencontainers.image.source=https://gitea.lokcal.de/loki/UpdatePlaner" \
--label "org.opencontainers.image.revision=${{ gitea.sha }}" \
-t "$IMAGE:${{ gitea.sha }}" \
-t "$IMAGE:latest" .
- name: Push
run: |
IMAGE="gitea.lokcal.de/loki/update-planer"
docker push "$IMAGE:${{ gitea.sha }}"
docker push "$IMAGE:latest"
+34
View File
@@ -0,0 +1,34 @@
FROM node:22-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22-slim AS server-build
WORKDIR /app
COPY server/package*.json ./server/
COPY server/tsconfig.json ./server/
COPY server/src/ ./server/src/
RUN cd server && npm ci && npx tsc
FROM node:22-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=server-build /app/server/dist ./server/dist
COPY --from=server-build /app/server/node_modules ./server/node_modules
COPY .env.example ./.env.example
EXPOSE 3001
VOLUME ["/data"]
ENV DATABASE_PATH=/data/app.db
ENV NODE_ENV=production
CMD ["node", "server/dist/index.js"]