|
1 | | -# Copyright (c) Meta Platforms, Inc. and affiliates. |
2 | | -# All rights reserved. |
3 | | -# |
4 | | -# This source code is licensed under the BSD-style license found in the |
5 | | -# LICENSE file in the root directory of this source tree. |
| 1 | +# Base image |
| 2 | +FROM python:3.11-slim |
6 | 3 |
|
7 | | -# Use the standard openenv base image |
8 | | -# Built from: docker build -t openenv-base:latest -f src/core/containers/images/Dockerfile . |
9 | | -# In GitHub Actions, this is overridden to use the GHCR base image |
10 | | -ARG BASE_IMAGE=openenv-base:latest |
11 | | -FROM ${BASE_IMAGE} |
| 4 | +# Set working directory |
| 5 | +WORKDIR /app/env |
12 | 6 |
|
13 | | -# Copy only what's needed for this environment |
14 | | -COPY src/core/ /app/src/core/ |
15 | | -COPY src/envs/coding_env/ /app/src/envs/coding_env/ |
| 7 | +# Install system dependencies |
| 8 | +RUN apt-get update && apt-get install -y \ |
| 9 | + git \ |
| 10 | + && rm -rf /var/lib/apt/lists/* |
16 | 11 |
|
17 | | -# Copy README for web interface documentation |
18 | | -COPY src/envs/coding_env/README.md /app/README.md |
| 12 | +# Copy environment files |
| 13 | +COPY . . |
19 | 14 |
|
20 | | -# Health check |
21 | | -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ |
22 | | - CMD curl -f http://localhost:8000/health || exit 1 |
| 15 | +# Install Python dependencies |
| 16 | +RUN pip install --no-cache-dir -e . |
23 | 17 |
|
24 | | -# Run the FastAPI server |
25 | | -CMD ["uvicorn", "envs.coding_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"] |
| 18 | +# Expose port |
| 19 | +EXPOSE 8000 |
| 20 | + |
| 21 | +# Set environment variables |
| 22 | +ENV PYTHONUNBUFFERED=1 |
| 23 | +ENV ENABLE_WEB_INTERFACE=true |
| 24 | + |
| 25 | +# Run the server |
| 26 | +CMD ["python", "-m", "uvicorn", "coding_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"] |
0 commit comments