-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.46 KB
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
# Copyright 2023 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-FileCopyrightText: Copyright 2023 Canonical Ltd.
# SPDX-License-Identifier: AGPL-3.0-only
FROM ubuntu:24.04
ARG UV_DYNAMIC_VERSIONING_BYPASS=0.0.0
COPY --from=ghcr.io/astral-sh/uv:0.10.10 /uv /uvx /bin/
ENV UV_SYSTEM_PYTHON=true
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV VIRTUAL_ENV=/home/app/.venv
ENV PATH=/home/app/.venv/bin:$PATH
EXPOSE 30000
EXPOSE 9090
WORKDIR /home/app
RUN apt-get update && \
apt-get install -y python3.12 curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV PYTHONPATH=/home/app
COPY uv.lock .
COPY pyproject.toml .
COPY . .
ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --all-groups
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=40s CMD curl --fail http://localhost:30000/v1/version || exit 1
WORKDIR /home/app
CMD ["./dev_entrypoint.sh"]