mirror of
https://github.com/DumbWareio/DumbWhoIs.git
synced 2026-01-09 06:11:19 +08:00
21 lines
373 B
Docker
21 lines
373 B
Docker
# Add multi-stage build
|
|
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
FROM node:18-alpine
|
|
WORKDIR /app
|
|
COPY --from=builder /app .
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD wget -qO- http://localhost:3000/health || exit 1
|
|
|
|
# Start the application
|
|
CMD ["npm", "start"] |