-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
29 lines (20 loc) · 1.1 KB
/
Copy pathDockerfile.server
File metadata and controls
29 lines (20 loc) · 1.1 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
# syntax=docker/dockerfile:1.7
ARG BUNNYLAND_SERVER_IMAGE=ghcr.io/thalismind/bunnyland-server:main
FROM ${BUNNYLAND_SERVER_IMAGE} AS plugin
WORKDIR /plugin/bunnyland-rl
COPY server/pyproject.toml server/README.md ./
COPY server/src ./src
RUN --mount=type=cache,id=uv-cache,target=/root/.cache/uv,sharing=locked \
uv build --wheel --out-dir /tmp/bunnyland-rl-dist . && \
wheel="$(find /tmp/bunnyland-rl-dist -maxdepth 1 -type f -name '*.whl' -print -quit)" && \
test -n "$wheel" && \
uv pip install --python /app/.venv/bin/python \
--index pytorch-cpu=https://download.pytorch.org/whl/cpu \
--index-strategy unsafe-best-match "${wheel}[tracking]"
FROM plugin AS test
COPY server/tests ./tests
RUN mkdir -p /reports
ENTRYPOINT ["uv"]
CMD ["run", "--project", "/app", "--with", "pytest", "-m", "pytest", "/plugin/bunnyland-rl/tests", "--junitxml=/reports/server.xml"]
FROM plugin AS runtime
CMD ["serve", "--module", "bunnyland_rl", "--generator", "lifesim-demo", "--ticks", "0", "--api-host", "0.0.0.0", "--api-port", "8765", "--save", "/data/worlds/main.json", "--autosave-every", "20"]