Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 687b0e251a | |||
| d7c87bca5c |
+5
-5
@@ -1,15 +1,15 @@
|
|||||||
## syntax=docker/dockerfile:1.7
|
## syntax=docker/dockerfile:1.7
|
||||||
|
|
||||||
# ---- deps ----
|
# ---- deps ----
|
||||||
FROM node:22-slim AS deps
|
FROM node:latest AS deps
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends libc6 openssl ca-certificates \
|
RUN apt-get update && apt-get install -y --no-install-recommends libc6 openssl ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json* ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN npm ci --no-audit --no-fund
|
RUN npm ci --no-audit --no-fund
|
||||||
|
|
||||||
# ---- build ----
|
# ---- build ----
|
||||||
FROM node:22-slim AS builder
|
FROM node:latest AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -17,7 +17,7 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ---- runner ----
|
# ---- runner ----
|
||||||
FROM node:22-slim AS runner
|
FROM node:latest AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
@@ -25,7 +25,7 @@ ENV PORT=3000
|
|||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=0.0.0.0
|
||||||
|
|
||||||
RUN groupadd --system --gid 1001 nodejs \
|
RUN groupadd --system --gid 1001 nodejs \
|
||||||
&& useradd --system --uid 1001 --gid nodejs nextjs
|
&& useradd --system --uid 1001 --gid nodejs nextjs
|
||||||
|
|
||||||
# Standalone output copies only what's needed at runtime.
|
# Standalone output copies only what's needed at runtime.
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|||||||
@@ -1,15 +1,3 @@
|
|||||||
## Portainer stack for dndextended.
|
|
||||||
## Env vars come from Portainer stack env or a .env file in the same dir.
|
|
||||||
##
|
|
||||||
## Required env:
|
|
||||||
## MONGODB_URI - mongodb://mongo:27017/dndextended (or external cluster)
|
|
||||||
## AUTH_SECRET - openssl rand -base64 32
|
|
||||||
## AUTH_URL - public URL (https://dnd.example.com)
|
|
||||||
## AUTH_TRUST_HOST - true (behind Traefik/nginx/Pinggy)
|
|
||||||
##
|
|
||||||
## Optional:
|
|
||||||
## MONGO_ROOT_USER, MONGO_ROOT_PASSWORD - if you want mongo auth (recommended in prod)
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build:
|
build:
|
||||||
@@ -24,33 +12,3 @@ services:
|
|||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
MONGODB_URI: ${MONGODB_URI:-mongodb://mongo:27017/dndextended}
|
MONGODB_URI: ${MONGODB_URI:-mongodb://mongo:27017/dndextended}
|
||||||
AUTH_SECRET: ${AUTH_SECRET}
|
AUTH_SECRET: ${AUTH_SECRET}
|
||||||
depends_on:
|
|
||||||
mongo:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- dnd
|
|
||||||
|
|
||||||
mongo:
|
|
||||||
image: mongo:7
|
|
||||||
container_name: dndextended-mongo
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- mongo_data:/data/db
|
|
||||||
environment:
|
|
||||||
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER:-}
|
|
||||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-}
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
start_period: 20s
|
|
||||||
networks:
|
|
||||||
- dnd
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mongo_data:
|
|
||||||
|
|
||||||
networks:
|
|
||||||
dnd:
|
|
||||||
driver: bridge
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"model": "qwen2.5-coder:7b",
|
|
||||||
"messages": [{"role": "user", "content": "What is 2+2? Use the calculator tool."}],
|
|
||||||
"tools": [{
|
|
||||||
"type": "function",
|
|
||||||
"function": {
|
|
||||||
"name": "calculator",
|
|
||||||
"description": "Adds two numbers",
|
|
||||||
"parameters": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {"a": {"type": "number"}, "b": {"type": "number"}},
|
|
||||||
"required": ["a", "b"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user