-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 868 Bytes
/
Dockerfile
File metadata and controls
26 lines (20 loc) · 868 Bytes
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
FROM python:3.12
# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 - && \
ln -s /root/.local/bin/poetry /usr/local/bin/poetry
WORKDIR /app
# Copy project files
COPY mlops ./mlops/
COPY model.yaml ./
COPY pyproject.toml poetry.lock ./
# The model file should not be hard copied, as it is an artifact that can change over time.
# We should use volume mapping for that, so that the container can access the artifact stored.
# If you prefer not to use volumes, uncomment the following line (at your own risk).
# COPY artifacts ./artifacts
# Install project dependencies using poetry
# We use --no-root to install only dependencies first
# Then install the project itself
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi --only main
ENTRYPOINT ["poetry", "run", "python", "mlops/."]
CMD ["run"]