-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (37 loc) · 1.75 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (37 loc) · 1.75 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
FROM ubuntu@sha256:2260313b31c8c011cd2eebe728008efac1b3982be73eb71348ea2648d2c0e09b
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
WORKBENCH_OFFLINE=1 \
PIP_DEFAULT_TIMEOUT=120 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_RETRIES=10 \
PATH=/opt/workbench-venv/bin:$PATH
RUN printf 'Acquire::Retries "10";\nAcquire::http::Timeout "120";\nAcquire::https::Timeout "120";\n' \
> /etc/apt/apt.conf.d/80-workbench-retries \
&& sed -i 's/noble noble-updates noble-backports/noble noble-updates/' /etc/apt/sources.list.d/ubuntu.sources \
&& apt-get -o Acquire::Retries=10 update \
&& apt-get install -y --no-install-recommends ca-certificates curl python3 python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/* \
&& python3 -m venv /opt/workbench-venv
WORKDIR /app
COPY pyproject.toml README.md README.zh-CN.md LICENSE NOTICE ./
COPY libs/application ./libs/application
COPY libs/contracts ./libs/contracts
COPY libs/hardware ./libs/hardware
COPY libs/kernel ./libs/kernel
COPY libs/task_utils ./libs/task_utils
COPY services/agent_runtime ./services/agent_runtime
COPY services/backend ./services/backend
COPY services/world_model ./services/world_model
COPY firmware/virtual_mcu ./firmware/virtual_mcu
RUN --mount=type=cache,target=/root/.cache/pip python -m pip install --no-compile . \
&& useradd --create-home --uid 10001 workbench \
&& chown -R workbench:workbench /app
COPY . /app
RUN chown -R workbench:workbench /app
USER workbench
EXPOSE 8080
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \
CMD curl --fail --silent http://127.0.0.1:8080/healthz > /dev/null || exit 1
CMD ["python", "-m", "workbench_backend.server", "--host", "0.0.0.0", "--port", "8080"]