u
This commit is contained in:
10
.dockerignore
Normal file
10
.dockerignore
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
node_modules
|
||||||
|
data
|
||||||
|
certs
|
||||||
|
.git
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
*.log
|
||||||
|
docs/api
|
||||||
|
scratch
|
||||||
45
Dockerfile
Normal file
45
Dockerfile
Normal 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
41
docker-compose.yml
Normal 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
|
||||||
Reference in New Issue
Block a user