All checks were successful
CI/CD / test-backend (pull_request) Successful in 30s
CI/CD / test-frontend (pull_request) Successful in 11s
CI/CD / build-and-deploy (pull_request) Successful in 5m38s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
- 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.
16 lines
561 B
Docker
16 lines
561 B
Docker
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"] |