Files
admin/host-stacks/vds-kzntsv/sched-custom/Dockerfile.custom

31 lines
1.5 KiB
Docker

# sched custom single-binary — embedded engine + admin API + UI morda + MCP + storage (MariaDB).
# Built on published @schedjs/* npm packages (artifacts that passed the gates).
# Runs custom-entry.mjs — one HTTP server :8080 routing /api, /mcp, / (morda).
# Auth at the boundary: everything EXCEPT /api/health + static UI assets requires Bearer SCHED_ADMIN_KEY.
#
# Build (context = this dir):
# docker build -f host-stacks/vds-kzntsv/sched-custom/Dockerfile.custom -t registry.kzntsv.site/sched-custom:0.12.1-mysql host-stacks/vds-kzntsv/sched-custom
# Run:
# docker run -e MYSQL_URL=mysql://sched:pw@mariadb:3306/sched?ssl={"rejectUnauthorized":false} \
# -e SCHED_ADMIN_KEY=... -e SCHED_TASKS=/app/config/tasks.json \
# registry.kzntsv.site/sched-custom:0.12.1-mysql
FROM node:24-alpine
WORKDIR /app
ENV NODE_ENV=production
RUN echo '{"name":"schedd","private":true,"packageManager":"yarn@4.18.0"}' > package.json \
&& corepack enable \
&& printf 'nodeLinker: node-modules\nnpmMinimalAgeGate: 0\n' > .yarnrc.yml \
&& CI=1 yarn add @schedjs/daemon@0.12.1 @schedjs/storage-mysql@0.4.0 @schedjs/admin-api@0.3.0 @schedjs/mcp@0.4.1 @schedjs/ui@0.3.0 mysql2@3 \
&& rm -f .yarnrc.yml \
&& yarn cache clean
ENV PATH="/app/node_modules/.bin:${PATH}"
COPY custom-entry.mjs /app/custom-entry.mjs
# Default tasks.json baked into the image (overridden on prod by a bind mount / SCHED_TASKS).
RUN echo '{"tasks":[]}' > /app/tasks.json
EXPOSE 8080
VOLUME ["/data"]
ENTRYPOINT ["node", "/app/custom-entry.mjs"]