40 lines
957 B
Docker
40 lines
957 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for WeasyPrint (PDF generation)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libpango-1.0-0 \
|
|
libpangocairo-1.0-0 \
|
|
libgdk-pixbuf-2.0-0 \
|
|
libffi-dev \
|
|
shared-mime-info \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy project files
|
|
COPY pyproject.toml README.md ./
|
|
COPY src/ src/
|
|
COPY config/ config/
|
|
|
|
# Install package with reports dependencies (for PDF export)
|
|
RUN pip install --no-cache-dir -e ".[reports]"
|
|
|
|
# Create data directory for SQLite and measurements
|
|
RUN mkdir -p /app/data/measurements /app/data/reports
|
|
|
|
# Streamlit configuration
|
|
RUN mkdir -p ~/.streamlit
|
|
RUN echo '[server]\n\
|
|
headless = true\n\
|
|
address = "0.0.0.0"\n\
|
|
port = 8080\n\
|
|
enableXsrfProtection = false\n\
|
|
enableCORS = false\n\
|
|
\n\
|
|
[browser]\n\
|
|
gatherUsageStats = false\n' > ~/.streamlit/config.toml
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["streamlit", "run", "src/py_dvt_ate/app/dashboard/app.py"]
|