30 lines
651 B
Docker
30 lines
651 B
Docker
# Backend Dockerfile
|
|
FROM node:18-slim
|
|
|
|
# Установка зависимостей для сборки нативных модулей
|
|
RUN apt-get update && apt-get install -y python3 build-essential curl && apt-get clean
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install --only=production
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 3001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:3001/health || exit 1
|
|
|
|
# Start application
|
|
CMD ["npm", "start"] |