This commit is contained in:
seb
2026-10-26 21:21:08 +00:00
parent 5d6d07e8bf
commit a5a9e51898
3 changed files with 96 additions and 0 deletions

10
.dockerignore Normal file
View File

@@ -0,0 +1,10 @@
node_modules
data
certs
.git
.env
.env.*
!.env.example
*.log
docs/api
scratch

45
Dockerfile Normal file
View File

@@ -0,0 +1,45 @@
# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim
# Install system libraries needed by native Node modules (better-sqlite3, canvas, sharp)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
python3 \
make \
g++ \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy sibling dependencies referenced by package.json ("file:../dashdbschema", "file:../llmorbiter")
COPY dashdbschema /dashdbschema
COPY llmorbiter /llmorbiter
# Copy dashback package manifests
COPY dashback/package*.json ./
# Install all dependencies (including devDependencies required by OpenAPI live docs generator)
RUN npm install
# Copy application source code
COPY dashback/src ./src
COPY dashback/scripts ./scripts
# Set production defaults
ENV NODE_ENV=production \
HOST=0.0.0.0 \
PORT=4208 \
HTTPS_PORT=0 \
SQLITE_PATH=/app/data/dash.db \
STORAGE_DIR=/app/data/storage \
BACKUP_DIR=/app/data/backups
EXPOSE 4208
CMD ["node", "src/index.js"]

41
docker-compose.yml Normal file
View File

@@ -0,0 +1,41 @@
services:
dashback:
build:
context: ..
dockerfile: dashback/Dockerfile
image: dashback:latest
container_name: dashback
read_only: true
user: "${UID:-1000}:${GID:-1000}"
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m
- /run:rw,noexec,nosuid,size=16m
networks:
- dash_net
ports:
- "127.0.0.1:4208:4208"
environment:
- HOST=0.0.0.0
- PORT=4208
- HTTPS_PORT=0
- MSSQL_SERVER=sql_server
- SQLITE_PATH=/app/data/dash.db
- STORAGE_DIR=/app/data/storage
- BACKUP_DIR=/app/data/backups
# If a .env file is present, its values will be loaded:
env_file:
- path: .env
required: false
volumes:
# Shared repo directory (read-only)
- .:/app:ro
# Writable data directory
- ./data:/app/data:rw
# Sibling repositories for local symlink resolution
- ../dashdbschema:/dashdbschema:ro
- ../llmorbiter:/llmorbiter:ro
restart: unless-stopped
networks:
dash_net:
external: true