OpenEnv runtime layer (pinned OpenEnv 86a180e)
Browse files- Dockerfile +11 -5
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Canonical OpenEnv runtime layer: a self-contained CPython (python-build-standalone) with the pinned
|
| 2 |
# OpenEnv release and its server dependencies at /opt/openenv. It contains no environment code.
|
| 3 |
# Any OpenEnv image, on any glibc Linux base, can take it with
|
| 4 |
-
# COPY --link --from=<this image>@sha256:... /
|
| 5 |
# so every image that does carries the same layer bytes.
|
| 6 |
FROM python:3.12-slim-bookworm AS build
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/* \
|
|
@@ -13,9 +13,15 @@ RUN uv python install 3.12 \
|
|
| 13 |
"openenv @ git+https://github.com/meta-pytorch/OpenEnv.git@86a180ede21e044f7929b9a7783ad83aa67d83a3" \
|
| 14 |
&& /opt/openenv/venv/bin/python -c "import openenv, fastapi, uvicorn"
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
COPY --from=build /opt/openenv /opt/openenv
|
| 19 |
-
COPY
|
| 20 |
EXPOSE 7860
|
| 21 |
-
CMD ["/opt/openenv/
|
|
|
|
| 1 |
# Canonical OpenEnv runtime layer: a self-contained CPython (python-build-standalone) with the pinned
|
| 2 |
# OpenEnv release and its server dependencies at /opt/openenv. It contains no environment code.
|
| 3 |
# Any OpenEnv image, on any glibc Linux base, can take it with
|
| 4 |
+
# COPY --link --from=<this image>@sha256:... / /
|
| 5 |
# so every image that does carries the same layer bytes.
|
| 6 |
FROM python:3.12-slim-bookworm AS build
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/* \
|
|
|
|
| 13 |
"openenv @ git+https://github.com/meta-pytorch/OpenEnv.git@86a180ede21e044f7929b9a7783ad83aa67d83a3" \
|
| 14 |
&& /opt/openenv/venv/bin/python -c "import openenv, fastapi, uvicorn"
|
| 15 |
|
| 16 |
+
RUN mkdir -p /opt/openenv/www && echo "OpenEnv runtime layer for Arena (pinned OpenEnv 86a180ede21e)." > /opt/openenv/www/index.html
|
| 17 |
+
|
| 18 |
+
FROM busybox:1.36.1-musl AS busybox
|
| 19 |
+
|
| 20 |
+
# The image holds nothing but the runtime tree, so `COPY --link --from=<this image> / /` adds exactly
|
| 21 |
+
# these files with exactly these timestamps: the copied layer comes out the same in every build.
|
| 22 |
+
# A static busybox serves one page so the Space itself can run without a base OS.
|
| 23 |
+
FROM scratch
|
| 24 |
COPY --from=build /opt/openenv /opt/openenv
|
| 25 |
+
COPY --from=busybox /bin/busybox /opt/openenv/bin/busybox
|
| 26 |
EXPOSE 7860
|
| 27 |
+
CMD ["/opt/openenv/bin/busybox", "httpd", "-f", "-p", "7860", "-h", "/opt/openenv/www"]
|