feat: packaging Docker (Dockerfile + compose, volumes data/reports)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
FROM node:22-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
RUN corepack enable
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
FROM node:22-bookworm-slim
|
||||
WORKDIR /app
|
||||
RUN corepack enable
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/server/db/migrations ./server/db/migrations
|
||||
COPY --from=build /app/templates ./templates
|
||||
ENV SU_DB_PATH=/data/system-update.db
|
||||
ENV SU_REPORTS_DIR=/reports
|
||||
EXPOSE 8787
|
||||
CMD ["node", "dist/index.js"]
|
||||
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
system-update:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
ports:
|
||||
- "8787:8787"
|
||||
environment:
|
||||
SU_MASTER_KEY: ${SU_MASTER_KEY:?définir SU_MASTER_KEY}
|
||||
volumes:
|
||||
- su-data:/data
|
||||
- su-reports:/reports
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
su-data:
|
||||
su-reports:
|
||||
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig({
|
||||
entry: ["server/index.ts"],
|
||||
outDir: "dist",
|
||||
format: ["esm"],
|
||||
platform: "node",
|
||||
target: "node22",
|
||||
bundle: true,
|
||||
noExternal: [/^(?!better-sqlite3|ssh2|cpu-features).*/],
|
||||
external: ["better-sqlite3", "ssh2", "cpu-features"],
|
||||
});
|
||||
Reference in New Issue
Block a user