-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
54 lines (41 loc) · 1.29 KB
/
dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
###############################
# Base Image #
###############################
ARG BASE_IMAGE=python:3.11-slim
FROM $BASE_IMAGE AS base
WORKDIR /app
ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_VIRTUALENVS_IN_PROJECT=false \
POETRY_NO_INTERACTION=1
ENV PATH="$PATH:$POETRY_HOME/bin"
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
gcc \
make \
&& rm -rf /var/lib/apt/lists/*
# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN poetry config virtualenvs.create false
###############################
# Install Dependencies #
###############################
FROM base AS dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root --no-dev --without embeddings
###############################
# Build Image #
###############################
FROM dependencies AS build
ARG BUILD_VERSION
COPY README.md /app/
COPY pyproject.toml poetry.lock /app/
COPY src/splatnlp /app/src/splatnlp
# Build the application
RUN poetry version $BUILD_VERSION && \
poetry build && \
poetry install --no-dev --without embeddings && \
poetry update
CMD ["poetry", "run", "uvicorn", "splatnlp.serve.app:app", "--host", "0.0.0.0", \
"--port", "9000"]