feat: add nodepad service with Docker configuration and Traefik routing

This commit is contained in:
2026-07-12 07:08:59 +08:00
parent 79beab9ce2
commit a81a1edf88
4 changed files with 50 additions and 1 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ services:
- traefik.swarm.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.heynote.entrypoints=https
- traefik.http.routers.heynote.rule=Host(`note.${DOMAIN}`) || Host(`note0.${DOMAIN}`) || Host(`n.${DOMAIN}`) || Host(`pad.${DOMAIN}`)
- traefik.http.routers.heynote.rule=Host(`note.${DOMAIN}`) || Host(`note0.${DOMAIN}`) || Host(`n.${DOMAIN}`)
# - traefik.http.routers.heynote.rule=HostRegexp(`note[0-9]{0,2}.${DOMAIN}`) || Host(`pad.${DOMAIN}`)
- traefik.http.routers.heynote.tls.certresolver=le
- traefik.http.routers.heynote.service=heynote_app
+18
View File
@@ -0,0 +1,18 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY ./nodepad/package*.json ./
RUN npm install
COPY ./nodepad .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/next.config.mjs ./
EXPOSE 3000
CMD ["npm", "run", "start"]
Submodule
+1
Submodule swarm/nodepad added at e72c2fdcc8
+30
View File
@@ -0,0 +1,30 @@
services:
nodepad:
container_name: nodepad
build:
context: .
dockerfile: inline.Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
# Add your AI model API keys below if needed by the app:
# - OPENAI_API_KEY=your_key_here
# - ANTHROPIC_API_KEY=your_key_here
restart: unless-stopped
networks:
- traefik-public
deploy:
labels:
- traefik.enable=true
- traefik.swarm.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.nodepad.entrypoints=https
- traefik.http.routers.nodepad.rule=Host(`pad.${DOMAIN}`)
- traefik.http.routers.nodepad.tls.certresolver=le
- traefik.http.routers.nodepad.service=nodepad_app
- traefik.http.routers.nodepad-local.entrypoints=https
- traefik.http.routers.nodepad-local.rule=Host(`pad.${LOCALDOMAIN}`)
- traefik.http.routers.nodepad-local.tls=true
- traefik.http.routers.nodepad-local.service=nodepad_app
- traefik.http.services.nodepad_app.loadbalancer.server.port=3000