Delete Dockerfile
Browse files- Dockerfile +0 -39
Dockerfile
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
# Stage 1: Build dependencies
|
| 2 |
-
FROM ghcr.io/astral-sh/uv:python3.11-slim AS builder
|
| 3 |
-
|
| 4 |
-
# Enable bytecode compilation and use copy instead of hardlinks
|
| 5 |
-
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
| 6 |
-
|
| 7 |
-
WORKDIR /app
|
| 8 |
-
|
| 9 |
-
# Copy configuration files
|
| 10 |
-
COPY pyproject.toml uv.lock ./
|
| 11 |
-
|
| 12 |
-
# Install dependencies into a virtual environment
|
| 13 |
-
RUN uv sync --frozen --no-dev
|
| 14 |
-
|
| 15 |
-
# Stage 2: Runtime
|
| 16 |
-
FROM python:3.11-slim AS runtime
|
| 17 |
-
|
| 18 |
-
WORKDIR /app
|
| 19 |
-
|
| 20 |
-
# Copy the virtual environment from the builder
|
| 21 |
-
COPY --from=builder /app/.venv /app/.venv
|
| 22 |
-
|
| 23 |
-
# Ensure the virtual environment is in the PATH
|
| 24 |
-
ENV PATH="/app/.venv/bin:$PATH"
|
| 25 |
-
|
| 26 |
-
# Create non-root user for security
|
| 27 |
-
# Hugging Face Spaces uses UID 1000
|
| 28 |
-
RUN useradd -m -u 1000 appuser
|
| 29 |
-
|
| 30 |
-
# Copy application code
|
| 31 |
-
COPY app/ ./app/
|
| 32 |
-
|
| 33 |
-
# Switch to non-root user
|
| 34 |
-
USER appuser
|
| 35 |
-
|
| 36 |
-
EXPOSE 7860
|
| 37 |
-
|
| 38 |
-
# Run the application using uvicorn from the virtual environment
|
| 39 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|