new node.js impl., removed old stuff
This commit is contained in:
34
email-worker-nodejs/Dockerfile
Normal file
34
email-worker-nodejs/Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# ── Build stage ──────────────────────────────────────────────────
|
||||
FROM node:20-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci
|
||||
|
||||
COPY tsconfig.json ./
|
||||
COPY src/ ./src/
|
||||
|
||||
RUN npx tsc
|
||||
|
||||
# ── Run stage ────────────────────────────────────────────────────
|
||||
FROM node:20-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Only production deps
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
|
||||
# Compiled JS from build stage
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Config directory (mount domains.txt here)
|
||||
RUN mkdir -p /etc/email-worker /var/log/email-worker
|
||||
|
||||
EXPOSE 8000 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD node -e "fetch('http://localhost:8080').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
|
||||
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in New Issue
Block a user