31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM python:3.12 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential curl
|
||||
|
||||
RUN curl -Ls https://astral.sh/uv/install.sh | bash
|
||||
|
||||
ENV PATH="/root/.local/bin:$PATH"
|
||||
|
||||
COPY pyproject.toml .
|
||||
|
||||
RUN uv venv /install && \
|
||||
. /install/bin/activate && \
|
||||
uv pip install .
|
||||
|
||||
# Stage 2: Final image
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /install /opt/venv
|
||||
|
||||
# Activate virtualenv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
COPY ./app .
|
||||
|
||||
RUN ls -la | echo
|
||||
|
||||
ENTRYPOINT ["python", "-m", "main" ]
|
Reference in New Issue
Block a user