fix(deploy): add env vars to docker-compose, prisma generate in Dockerfile, move @prisma/client to deps
This commit is contained in:
+23
-13
@@ -8,7 +8,7 @@
|
|||||||
NEXT_PUBLIC_APP_NAME=ArchiTools
|
NEXT_PUBLIC_APP_NAME=ArchiTools
|
||||||
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||||
|
|
||||||
# Storage adapter: 'localStorage' (default) | 'api' | 'minio'
|
# Storage adapter: 'localStorage' (default) | 'database'
|
||||||
NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
|
NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
|
||||||
|
|
||||||
# Feature flag overrides (set to 'true' or 'false')
|
# 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_MINI_UTILITIES=false
|
||||||
# NEXT_PUBLIC_FLAG_MODULE_AI_CHAT=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 Object Storage
|
||||||
# MINIO_ACCESS_KEY=
|
# =============================================================================
|
||||||
# MINIO_SECRET_KEY=
|
MINIO_ENDPOINT=10.10.10.166
|
||||||
# MINIO_BUCKET=architools
|
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
|
# Authentication (Authentik OIDC)
|
||||||
# AUTHENTIK_CLIENT_ID=
|
# =============================================================================
|
||||||
# AUTHENTIK_CLIENT_SECRET=
|
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
|
# N8N_WEBHOOK_URL=http://10.10.10.166:5678/webhook
|
||||||
|
|
||||||
# External tool URLs (displayed in dashboard)
|
# External tool URLs (displayed in dashboard)
|
||||||
|
|||||||
+12
@@ -9,6 +9,18 @@ FROM node:20-alpine AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
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
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 3: Runner
|
# Stage 3: Runner
|
||||||
|
|||||||
+22
-5
@@ -1,16 +1,33 @@
|
|||||||
version: '3.8'
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
architools:
|
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
|
container_name: architools
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- NEXT_PUBLIC_APP_NAME=ArchiTools
|
# Database
|
||||||
- NEXT_PUBLIC_APP_URL=${APP_URL:-http://10.10.10.166:3000}
|
- DATABASE_URL=${DATABASE_URL:-postgresql://architools_user:stictMyFon34!_gonY@10.10.10.166:5432/architools_db?schema=public}
|
||||||
- NEXT_PUBLIC_STORAGE_ADAPTER=localStorage
|
# 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:
|
labels:
|
||||||
- "com.centurylinklabs.watchtower.enable=true"
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -13,6 +13,7 @@
|
|||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"lucide-react": "^0.564.0",
|
"lucide-react": "^0.564.0",
|
||||||
|
"@prisma/client": "^6.19.2",
|
||||||
"minio": "^8.0.6",
|
"minio": "^8.0.6",
|
||||||
"next": "16.1.6",
|
"next": "16.1.6",
|
||||||
"next-auth": "^4.24.13",
|
"next-auth": "^4.24.13",
|
||||||
@@ -25,7 +26,6 @@
|
|||||||
"uuid": "^13.0.0"
|
"uuid": "^13.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@prisma/client": "^6.19.2",
|
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
"@types/jszip": "^3.4.0",
|
"@types/jszip": "^3.4.0",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
|
|||||||
@@ -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();
|
|
||||||
Reference in New Issue
Block a user