anvisinghh commited on
Commit
73112c4
·
verified ·
1 Parent(s): 98aeb91

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -17
Dockerfile CHANGED
@@ -1,17 +1,34 @@
1
- # Use a lightweight Python image
2
- FROM python:3.9-slim
3
-
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Copy all your files (env.py, models.py, etc.) into the container
8
- COPY . .
9
-
10
- # Install the required libraries
11
- RUN pip install --no-cache-dir fastapi pydantic openenv-core uvicorn
12
-
13
- # Expose the port your env.py is running on
14
- EXPOSE 8000
15
-
16
- # Command to run your environment server
17
- CMD ["python", "env.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies needed for some Python packages
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy the requirements file first to leverage Docker cache
13
+ # (Ensure your file is named requirements.txt on Hugging Face)
14
+ COPY requirements.txt .
15
+
16
+ # Install the necessary libraries
17
+ # We include 'openenv' specifically to fix the ModuleNotFoundError
18
+ RUN pip install --no-cache-dir --upgrade pip && \
19
+ pip install --no-cache-dir \
20
+ fastapi \
21
+ uvicorn \
22
+ pydantic \
23
+ openai \
24
+ openenv
25
+
26
+ # Copy the rest of your application code
27
+ COPY . .
28
+
29
+ # Expose port 8000 (standard for FastAPI/OpenEnv)
30
+ EXPOSE 8000
31
+
32
+ # Command to run the OpenEnv server
33
+ # This points to your 'env' file and the 'app' instance inside it
34
+ CMD ["uvicorn", "env:app", "--host", "0.0.0.0", "--port", "8000"]