Crashbandicoote2 commited on
Commit
5b54335
·
verified ·
1 Parent(s): 20bb95e

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +16 -24
  2. server/Dockerfile.backup +33 -0
Dockerfile CHANGED
@@ -1,34 +1,26 @@
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.
6
 
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}
12
 
13
- # Install dependencies
14
- COPY src/envs/snake_env/server/requirements.txt /tmp/requirements.txt
15
- RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
 
16
 
17
- # Copy only what's needed for this environment
18
- COPY src/core/ /app/src/core/
19
- COPY src/envs/snake_env/ /app/src/envs/snake_env/
20
 
21
- # Copy README for web interface documentation
22
- COPY src/envs/snake_env/README.md /app/README.md
23
 
24
  # Expose port
25
  EXPOSE 8000
26
 
27
- # Health check
28
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
29
- CMD curl -f http://localhost:8000/health || exit 1
30
-
31
- # Run the FastAPI server
32
- # CMD ["uvicorn", "envs.snake_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
33
  ENV ENABLE_WEB_INTERFACE=true
 
 
34
  CMD ["python", "-m", "uvicorn", "envs.snake_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Base image
2
+ FROM python:3.11-slim
 
 
 
3
 
4
+ # Set working directory
5
+ WORKDIR /app/env
 
 
 
6
 
7
+ # Install system dependencies (if needed)
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy environment files
13
+ COPY . .
 
14
 
15
+ # Install Python dependencies
16
+ RUN pip install --no-cache-dir -e .
17
 
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", "envs.snake_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
server/Dockerfile.backup ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.
6
+
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}
12
+
13
+ # Install dependencies
14
+ COPY src/envs/snake_env/server/requirements.txt /tmp/requirements.txt
15
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
16
+
17
+ # Copy only what's needed for this environment
18
+ COPY src/core/ /app/src/core/
19
+ COPY src/envs/snake_env/ /app/src/envs/snake_env/
20
+
21
+ # Copy README for web interface documentation
22
+ COPY src/envs/snake_env/README.md /app/README.md
23
+
24
+ # Expose port
25
+ EXPOSE 8000
26
+
27
+ # Health check
28
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
29
+ CMD curl -f http://localhost:8000/health || exit 1
30
+
31
+ # Run the FastAPI server
32
+ # CMD ["uvicorn", "envs.snake_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]
33
+ CMD ["python", "-m", "uvicorn", "envs.snake_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]