Files
python-common-app/Dockerfile
EremeevRA cc14322c12
All checks were successful
CI/CD / test-frontend (pull_request) Successful in 10s
CI/CD / test-backend (pull_request) Successful in 28s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
CI/CD / build-and-deploy (pull_request) Successful in 26s
Refactor Dockerfile and CI workflow for improved dependency management and cleanup
- Updated Dockerfile to optimize layer caching by copying requirements.txt before application code.
- Added caching for pip packages in CI workflow to speed up dependency installation.
- Implemented cleanup of dangling Docker images post-deployment.
2026-04-02 18:50:50 +03:00

16 lines
561 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM python:3.11-slim
WORKDIR /app
# 1. Копируем только файл с зависимостями (меняется редко)
COPY api/requirements.txt requirements.txt
# 2. Устанавливаем зависимости (слой кэшируется, пока не изменился requirements.txt)
RUN pip install --no-cache-dir -r requirements.txt
# 3. Копируем весь остальной код (меняется часто)
COPY api/ api/
EXPOSE 8000
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]