ai-station/Dockerfile

30 lines
734 B
Docker
Raw Normal View History

2025-12-26 16:48:51 +00:00
FROM python:3.11-slim
2025-12-25 14:54:33 +00:00
WORKDIR /app
2025-12-26 16:48:51 +00:00
# Installa dipendenze sistema
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Copia requirements e installa
2025-12-25 14:54:33 +00:00
COPY requirements.txt .
2025-12-26 16:48:51 +00:00
RUN pip install --no-cache-dir -r requirements.txt
# Copia applicazione
COPY app.py .
COPY init_db.py .
# Crea directory necessarie
RUN mkdir -p /app/workspaces /app/public /app/.files
2025-12-25 14:54:33 +00:00
2025-12-26 16:48:51 +00:00
EXPOSE 8000
2025-12-25 14:54:33 +00:00
2025-12-29 05:50:06 +00:00
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import httpx; httpx.get('http://localhost:8000/health', timeout=5)" || exit 1
2025-12-26 16:48:51 +00:00
# Script di avvio con inizializzazione DB
CMD python init_db.py && chainlit run app.py --host 0.0.0.0 --port 8000