Dockerfile 643 B

123456789101112131415161718192021222324252627282930
  1. FROM python:3.12-slim
  2. WORKDIR /app
  3. ARG APP_VERSION=dev
  4. ENV PYTHONDONTWRITEBYTECODE=1 \
  5. PYTHONUNBUFFERED=1 \
  6. PYTHONPATH=/app \
  7. MPLBACKEND=Agg \
  8. SERVICE_PORT=8002 \
  9. APP_VERSION=${APP_VERSION}
  10. LABEL org.opencontainers.image.title="srv-spectroscopy" \
  11. org.opencontainers.image.version="${APP_VERSION}"
  12. RUN apt-get update && apt-get install -y --no-install-recommends \
  13. libgomp1 \
  14. libgfortran5 \
  15. curl \
  16. && rm -rf /var/lib/apt/lists/*
  17. COPY requirements.txt .
  18. RUN pip install --no-cache-dir -r requirements.txt
  19. COPY . .
  20. EXPOSE 8002
  21. CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8002"]