FROM node:20-alpine WORKDIR /app ENV NODE_ENV=production ENV LANG=C.UTF-8 ENV LC_ALL=C.UTF-8 # Зависимости для better-sqlite3 (нужна компиляция) RUN apk add --no-cache python3 make g++ COPY package*.json ./ RUN npm install --omit=dev --no-audit --no-fund \ && npm cache clean --force COPY server.js ./ COPY public/ ./public/ # Папка для базы данных RUN mkdir -p /data EXPOSE 3000 ENV PORT=3000 ENV DB_PATH=/data/intradesk.db HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ CMD node -e "const http=require('http');const req=http.get('http://127.0.0.1:3000/healthz',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));" CMD ["node", "server.js"]