|
|
|
|
|
|
|
|
FROM node:18-slim AS frontend-builder |
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY package*.json ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN npm install |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY *.html ./ |
|
|
|
|
|
COPY *.js ./ |
|
|
|
|
|
COPY config.js ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM python:3.10-slim |
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
|
|
|
gcc \ |
|
|
|
|
|
g++ \ |
|
|
|
|
|
curl \ |
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY backend/ ./backend/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY *.py ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY --from=frontend-builder /app/*.html ./ |
|
|
|
|
|
COPY --from=frontend-builder /app/*.js ./ |
|
|
|
|
|
COPY --from=frontend-builder /app/config.js ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY api/ ./api/ |
|
|
|
|
|
COPY collectors/ ./collectors/ |
|
|
|
|
|
COPY database/ ./database/ |
|
|
|
|
|
COPY monitoring/ ./monitoring/ |
|
|
|
|
|
COPY scripts/ ./scripts/ |
|
|
|
|
|
COPY tests/ ./tests/ |
|
|
|
|
|
COPY utils/ ./utils/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY *.json ./ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p data logs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN chmod -R 755 data logs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ |
|
|
|
|
|
CMD curl -f http://localhost:7860/health || exit 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"] |
|
|
|
|
|
|