zkt26/z1/api/Dockerfile

21 lines
424 B
Docker

FROM node:20-alpine
WORKDIR /app
# Copy package files and install dependencies
COPY package.json ./
RUN npm install --production
# Copy application source
COPY . .
# Expose API port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
# Start the application
CMD ["node", "server.js"]