File size: 1,126 Bytes
ca29807
 
 
 
 
 
4eb7f58
 
ca29807
4eb7f58
ca29807
 
4eb7f58
 
d854dca
 
 
4eb7f58
 
ca29807
4eb7f58
 
 
 
ca29807
4eb7f58
 
ca29807
4eb7f58
 
 
ca29807
4eb7f58
d854dca
 
ca29807
 
4eb7f58
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Base image
FROM ghcr.io/meta-pytorch/openenv-base:sha-7dd8148

# Set working directory
WORKDIR /app/env

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy environment files
COPY . .

# Install Python dependencies
# Install latest openenv-core from GitHub (PyPI version has older web UI)
RUN pip install --no-cache-dir "openenv-core @ git+https://github.com/meta-pytorch/OpenEnv.git"
RUN pip install --no-cache-dir -e .

# Expose port
EXPOSE 8000

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV ENABLE_WEB_INTERFACE=true

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1

# Run the FastAPI server
CMD ["python", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]