CoolFace
Apppublic

Supabase/image-search

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes
Dockerfile36 linesDownload Raw Back to root
1# The builder image, used to build the virtual environment2FROM python:3.11-buster as builder3 4RUN pip install poetry==1.4.25 6ENV POETRY_NO_INTERACTION=1 \7    POETRY_VIRTUALENVS_IN_PROJECT=1 \8    POETRY_VIRTUALENVS_CREATE=1 \9    POETRY_CACHE_DIR=/tmp/poetry_cache10 11WORKDIR /app12 13COPY pyproject.toml poetry.lock ./14 15RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root16 17# The runtime image, used to just run the code provided its virtual environment18FROM python:3.11-slim-buster as runtime19 20# Get secret DB_URL and output it to /test at buildtime21# RUN --mount=type=secret,id=DB_URL,mode=0444,required=true \22#    cat /run/secrets/DB_URL > /test23 24ENV VIRTUAL_ENV=/app/.venv \25    PATH="/app/.venv/bin:$PATH"26 27COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}28 29COPY image_search /image_search30COPY static /static31COPY images /images32 33RUN ls -la ${VIRTUAL_ENV}34 35CMD ["uvicorn", "image_search.main:app", "--host", "0.0.0.0", "--port", "7860"]36