Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 616 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. FROM python:3.12-slim as builder
  2. RUN pip install poetry==1.4.2
  3. ENV POETRY_NO_INTERACTION=1 \
  4. POETRY_VIRTUALENVS_IN_PROJECT=1 \
  5. POETRY_VIRTUALENVS_CREATE=1 \
  6. POETRY_CACHE_DIR=/tmp/poetry_cache
  7. WORKDIR /app
  8. COPY pyproject.toml poetry.lock ./
  9. RUN touch README.md
  10. RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
  11. FROM python:3.12-slim as runtime
  12. ENV VIRTUAL_ENV=/app/.venv \
  13. PATH="/app/.venv/bin:$PATH"
  14. COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
  15. COPY . ./app
  16. WORKDIR /app
  17. CMD ["uvicorn", "src.serve.main:app", "--host", "0.0.0.0", "--port", "8000"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...