forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.desktop_backend
More file actions
28 lines (19 loc) · 1006 Bytes
/
Copy pathDockerfile.desktop_backend
File metadata and controls
28 lines (19 loc) · 1006 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
27
28
ARG PYTHON_BASE_IMAGE=gcr.io/based-hardware-dev/python:3.11-slim-forky
ARG UV_VERSION=0.11.13
FROM ${PYTHON_BASE_IMAGE} AS builder
ARG UV_VERSION
RUN python -m venv /opt/venv
RUN python3 -m pip install --no-cache-dir "uv==${UV_VERSION}"
# pyogg is locked from a Git source, so uv needs git available while syncing.
RUN apt-get update && apt-get install -y --no-install-recommends git build-essential && rm -rf /var/lib/apt/lists/*
COPY backend/pylock.runtime.toml /tmp/pylock.runtime.toml
RUN uv pip sync /tmp/pylock.runtime.toml --python /opt/venv/bin/python --compile-bytecode
FROM ${PYTHON_BASE_IMAGE}
WORKDIR /app
ENV PATH="/opt/venv/bin:$PATH"
# Patch OS packages in this layer (#7136). No extra apt packages in the final image.
RUN apt-get update && apt-get -y dist-upgrade && rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/venv /opt/venv
COPY backend/ .
EXPOSE 8080
CMD ["uvicorn", "desktop_backend:create_app", "--factory", "--host", "0.0.0.0", "--port", "8080", "--loop", "uvloop"]