fix(deploy): add env vars to docker-compose, prisma generate in Dockerfile, move @prisma/client to deps

This commit is contained in:
AI Assistant
2026-02-27 10:43:32 +02:00
parent 0ad7e835bd
commit ccba14a05e
8 changed files with 58 additions and 42 deletions
+23 -13
View File
@@ -8,7 +8,7 @@
NEXT_PUBLIC_APP_NAME=ArchiTools
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Storage adapter: 'localStorage' (default) | 'api' | 'minio'
# Storage adapter: 'localStorage' (default) | 'database'
NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
# Feature flag overrides (set to 'true' or 'false')
@@ -25,21 +25,31 @@ NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
# NEXT_PUBLIC_FLAG_MODULE_MINI_UTILITIES=false
# NEXT_PUBLIC_FLAG_MODULE_AI_CHAT=false
# Future: API storage backend
# STORAGE_API_URL=http://api.internal/storage
# =============================================================================
# PostgreSQL Database (required when STORAGE_ADAPTER=database)
# =============================================================================
DATABASE_URL=postgresql://USER:PASSWORD@10.10.10.166:5432/architools_db?schema=public
# Future: MinIO object storage
# MINIO_ENDPOINT=10.10.10.166:9003
# MINIO_ACCESS_KEY=
# MINIO_SECRET_KEY=
# MINIO_BUCKET=architools
# =============================================================================
# MinIO Object Storage
# =============================================================================
MINIO_ENDPOINT=10.10.10.166
MINIO_PORT=9002
MINIO_USE_SSL=false
MINIO_ACCESS_KEY=admin
MINIO_SECRET_KEY=your-minio-secret
MINIO_BUCKET_NAME=tools
# Future: Authentik SSO
# AUTHENTIK_URL=http://10.10.10.166:9100
# AUTHENTIK_CLIENT_ID=
# AUTHENTIK_CLIENT_SECRET=
# =============================================================================
# Authentication (Authentik OIDC)
# =============================================================================
NEXTAUTH_URL=https://tools.beletage.ro
NEXTAUTH_SECRET=generate-with-openssl-rand-base64-32
AUTHENTIK_CLIENT_ID=your-authentik-client-id
AUTHENTIK_CLIENT_SECRET=your-authentik-client-secret
AUTHENTIK_ISSUER=https://auth.beletage.ro/application/o/architools/
# Future: N8N automation
# N8N automation (future)
# N8N_WEBHOOK_URL=http://10.10.10.166:5678/webhook
# External tool URLs (displayed in dashboard)
+12
View File
@@ -9,6 +9,18 @@ FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build args for NEXT_PUBLIC_* vars (inlined at build time)
ARG NEXT_PUBLIC_STORAGE_ADAPTER=database
ARG NEXT_PUBLIC_APP_NAME=ArchiTools
ARG NEXT_PUBLIC_APP_URL=https://tools.beletage.ro
ENV NEXT_PUBLIC_STORAGE_ADAPTER=${NEXT_PUBLIC_STORAGE_ADAPTER}
ENV NEXT_PUBLIC_APP_NAME=${NEXT_PUBLIC_APP_NAME}
ENV NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
# Generate Prisma client before building
RUN npx prisma generate
RUN npm run build
# Stage 3: Runner
+22 -5
View File
@@ -1,16 +1,33 @@
version: '3.8'
version: "3.8"
services:
architools:
build: .
build:
context: .
args:
- NEXT_PUBLIC_STORAGE_ADAPTER=${NEXT_PUBLIC_STORAGE_ADAPTER:-database}
- NEXT_PUBLIC_APP_NAME=${NEXT_PUBLIC_APP_NAME:-ArchiTools}
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-https://tools.beletage.ro}
container_name: architools
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_APP_NAME=ArchiTools
- NEXT_PUBLIC_APP_URL=${APP_URL:-http://10.10.10.166:3000}
- NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
# Database
- DATABASE_URL=${DATABASE_URL:-postgresql://architools_user:stictMyFon34!_gonY@10.10.10.166:5432/architools_db?schema=public}
# MinIO
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-10.10.10.166}
- MINIO_PORT=${MINIO_PORT:-9002}
- MINIO_USE_SSL=${MINIO_USE_SSL:-false}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-admin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-MinioStrongPass123}
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME:-tools}
# Authentication (Authentik OIDC)
- NEXTAUTH_URL=${NEXTAUTH_URL:-https://tools.beletage.ro}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- AUTHENTIK_CLIENT_ID=${AUTHENTIK_CLIENT_ID}
- AUTHENTIK_CLIENT_SECRET=${AUTHENTIK_CLIENT_SECRET}
- AUTHENTIK_ISSUER=${AUTHENTIK_ISSUER:-https://auth.beletage.ro/application/o/architools/}
labels:
- "com.centurylinklabs.watchtower.enable=true"
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -13,6 +13,7 @@
"clsx": "^2.1.1",
"jszip": "^3.10.1",
"lucide-react": "^0.564.0",
"@prisma/client": "^6.19.2",
"minio": "^8.0.6",
"next": "16.1.6",
"next-auth": "^4.24.13",
@@ -25,7 +26,6 @@
"uuid": "^13.0.0"
},
"devDependencies": {
"@prisma/client": "^6.19.2",
"@tailwindcss/postcss": "^4",
"@types/jszip": "^3.4.0",
"@types/node": "^20",
BIN
View File
Binary file not shown.
-23
View File
@@ -1,23 +0,0 @@
import { Client } from 'minio';
import * as dotenv from 'dotenv';
dotenv.config();
const minioClient = new Client({
endPoint: process.env.MINIO_ENDPOINT,
port: parseInt(process.env.MINIO_PORT),
useSSL: process.env.MINIO_USE_SSL === 'true',
accessKey: process.env.MINIO_ACCESS_KEY,
secretKey: process.env.MINIO_SECRET_KEY,
});
async function testMinio() {
try {
console.log('Testing MinIO connection on port', process.env.MINIO_PORT, '...');
const buckets = await minioClient.listBuckets();
console.log('Success! Buckets:', buckets.map(b => b.name));
} catch (err) {
console.error('MinIO Error:', err.message);
}
}
testMinio();