shared package.json config
Build and Deploy / build-and-push (push) Failing after 41s Details

This commit is contained in:
ImNotTheGuy 2026-04-20 16:42:19 +02:00
parent d30914208f
commit da90f82c45
27 changed files with 89 additions and 5 deletions

View File

@ -0,0 +1,32 @@
name: Build and Deploy
on: [ push ]
jobs:
build-and-push:
runs-on: ubuntu-latest # This refers to your self-hosted runner
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Registry
uses: docker/login-action@v2
with:
registry: git.ludops.com
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: git.ludops.com/${{ gitea.repository }}:latest
- name: Deploy to Server
run: |
# Here we tell the server to pull the new image and restart
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# Install dependencies
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
COPY apps/api/package.json ./apps/api/
COPY apps/web/package.json ./apps/web/
COPY packages/shared/package.json ./packages/shared/
RUN pnpm install --frozen-lockfile
# Copy source and build
COPY . .
RUN pnpm turbo run build
# Runner Stage
FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=base /app/apps/api/dist ./api
COPY --from=base /app/apps/web/dist ./web-dist
COPY --from=base /app/node_modules ./node_modules
# We need the shared package built files if they exist
COPY --from=base /app/packages/shared ./packages/shared
EXPOSE 3000
CMD ["node", "api/index.js"]

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -1,5 +1,5 @@
{ {
"name": "docs", "name": "api",
"version": "0.1.0", "version": "0.1.0",
"type": "module", "type": "module",
"private": true, "private": true,
@ -11,6 +11,7 @@
"check-types": "next typegen && tsc --noEmit" "check-types": "next typegen && tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@ludops/shared": "workspace:^",
"@repo/ui": "workspace:*", "@repo/ui": "workspace:*",
"next": "16.2.0", "next": "16.2.0",
"react": "^19.2.0", "react": "^19.2.0",

View File

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 645 B

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

View File

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 750 B

0
docker-compose.yml Normal file
View File

5
packages/shared/index.ts Normal file
View File

@ -0,0 +1,5 @@
export interface AppStatus {
status: string;
version: string;
database: boolean;
}

View File

@ -0,0 +1,7 @@
{
"name": "@ludops/shared",
"version": "0.0.0",
"private": true,
"main": "./index.ts",
"types": "./index.ts"
}

View File

@ -18,8 +18,11 @@ importers:
specifier: 5.9.2 specifier: 5.9.2
version: 5.9.2 version: 5.9.2
apps/docs: apps/api:
dependencies: dependencies:
'@ludops/shared':
specifier: workspace:^
version: link:../../packages/shared
'@repo/ui': '@repo/ui':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/ui version: link:../../packages/ui
@ -57,6 +60,9 @@ importers:
apps/web: apps/web:
dependencies: dependencies:
'@ludops/shared':
specifier: workspace:^
version: link:../../packages/shared
'@repo/ui': '@repo/ui':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/ui version: link:../../packages/ui
@ -128,6 +134,8 @@ importers:
specifier: ^8.50.0 specifier: ^8.50.0
version: 8.50.0(eslint@9.39.1)(typescript@5.9.2) version: 8.50.0(eslint@9.39.1)(typescript@5.9.2)
packages/shared: {}
packages/typescript-config: {} packages/typescript-config: {}
packages/ui: packages/ui:
@ -733,6 +741,7 @@ packages:
eslint-config-prettier@10.1.1: eslint-config-prettier@10.1.1:
resolution: {integrity: sha512-4EQQr6wXwS+ZJSzaR5ZCrYgLxqvUjdXctaEtBqHcbkW944B1NQyO4qpdHQbXBONfwxXdkAY81HH4+LUfrg+zPw==} resolution: {integrity: sha512-4EQQr6wXwS+ZJSzaR5ZCrYgLxqvUjdXctaEtBqHcbkW944B1NQyO4qpdHQbXBONfwxXdkAY81HH4+LUfrg+zPw==}
hasBin: true
peerDependencies: peerDependencies:
eslint: '>=7.0.0' eslint: '>=7.0.0'
@ -773,6 +782,7 @@ packages:
eslint@9.39.1: eslint@9.39.1:
resolution: {integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==} resolution: {integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies: peerDependencies:
jiti: '*' jiti: '*'
peerDependenciesMeta: peerDependenciesMeta:
@ -1118,6 +1128,7 @@ packages:
next@16.2.0: next@16.2.0:
resolution: {integrity: sha512-NLBVrJy1pbV1Yn00L5sU4vFyAHt5XuSjzrNyFnxo6Com0M0KrL6hHM5B99dbqXb2bE9pm4Ow3Zl1xp6HVY9edQ==} resolution: {integrity: sha512-NLBVrJy1pbV1Yn00L5sU4vFyAHt5XuSjzrNyFnxo6Com0M0KrL6hHM5B99dbqXb2bE9pm4Ow3Zl1xp6HVY9edQ==}
engines: {node: '>=20.9.0'} engines: {node: '>=20.9.0'}
hasBin: true
peerDependencies: peerDependencies:
'@opentelemetry/api': ^1.1.0 '@opentelemetry/api': ^1.1.0
'@playwright/test': ^1.51.1 '@playwright/test': ^1.51.1

View File

@ -4,8 +4,7 @@
"tasks": { "tasks": {
"build": { "build": {
"dependsOn": ["^build"], "dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"], "outputs": ["dist/**", ".dist/**"]
"outputs": [".next/**", "!.next/cache/**"]
}, },
"lint": { "lint": {
"dependsOn": ["^lint"] "dependsOn": ["^lint"]