embedding / Dockerfile
nam pham
feat: first update
4e5c5cb
raw
history blame
801 Bytes
ARG PYTHON_VERSION=3.12
FROM python:$PYTHON_VERSION-slim as builder
RUN pip install poetry==1.8.2
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR
FROM python:$PYTHON_VERSION-slim as runtime
####### Add your own installation commands here #######
# RUN pip install some-package
# RUN wget https://path/to/some/data/or/weights
# RUN apt-get update && apt-get install -y <package-name>
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY . /app
# Install litserve and requirements
EXPOSE 8000
CMD ["sh", "/app/bin/start-api.sh"]