Collaborative-pixel-art/backend/Dockerfile
2025-08-22 19:28:05 +02:00

26 lines
No EOL
466 B
Docker

FROM node:18-alpine
WORKDIR /app
# Copy package files
COPY backend/package*.json ./
COPY shared/ ../shared/
# Install dependencies
RUN npm install
# Copy source code
COPY backend/ .
# Build TypeScript
RUN npm run build
# Expose port
EXPOSE 3001
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3001/health || exit 1
# Start the application
CMD ["npm", "start"]