Compare commits

2 Commits
Author SHA1 Message Date
marc bbe65a3357 uv that works 2025-03-04 03:03:54 +01:00
marc ccc4cc4c6a dockerfile uv 2025-03-04 02:46:11 +01:00
2 changed files with 18 additions and 13 deletions
+17 -13
View File
@@ -1,19 +1,23 @@
FROM python:3.12-alpine
FROM python:3.12-slim as builder
ENV PORT=8000
ENV HOST=0.0.0.0
RUN apt-get update && apt-get install -y curl && \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
apt-get purge -y curl && \
rm -rf /var/lib/apt/lists/*
ENV PATH="/root/.cargo/bin:$PATH"
WORKDIR /app
RUn pip install uv granian
COPY requirements.txt .
RUN uv pip install -r requirements.txt --target /opt/dependencies
RUN pip install hypercorn
COPY requirements.txt ./
RUN pip install -r requirements.txt
FROM python:3.12-slim
ENV PYTHONPATH="/opt/dependencies:$PYTHONPATH"
COPY --from=builder /opt/dependencies /opt/dependencies
RUN pip install granian
COPY ./app /app
# ENV PATH="$PATH:/root/.local/bin"
WORKDIR /
COPY ./hypercorn.toml ./
ENTRYPOINT ["hypercorn", "-c", "hypercorn.toml", "app.main:app"]
ENTRYPOINT ["granian", "--interface", "asgi", "--host", "0.0.0.0", "--port", "8000", "--http", "auto", "app.main:app"]
+1
View File
@@ -2,3 +2,4 @@ services:
time-assistant:
image: marcpartensky/time-assistant
build: .
env_file: .env