Some checks failed
Build and Deploy Log Center / build-and-deploy (push) Failing after 14s
Buildkit ignores daemon.json registry-mirrors, so specify mirror directly in FROM statements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
680 B
Docker
25 lines
680 B
Docker
# Build stage - Python FastAPI application
|
|
FROM hub.rat.dev/library/python:3.12-slim AS build-stage
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt
|
|
|
|
# Production stage
|
|
FROM hub.rat.dev/library/python:3.12-slim AS production-stage
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy installed packages from build stage
|
|
COPY --from=build-stage /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
|
COPY --from=build-stage /usr/local/bin /usr/local/bin
|
|
|
|
# Copy application code
|
|
COPY app ./app
|
|
|
|
EXPOSE 8002
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8002"]
|