Skip to content

Commit 7f2384b

Browse files
authored
Merge pull request #125 from surfiniaburger/main
Updated dockerfile
2 parents db31b64 + 4bf5cdb commit 7f2384b

File tree

3 files changed

+14
-46
lines changed

3 files changed

+14
-46
lines changed

scripts/download_dataset.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/envs/dipg_safety_env/server/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
66
curl \
77
&& rm -rf /var/lib/apt/lists/*
88

9-
# Install all necessary Python packages for the server, including gunicorn
10-
RUN pip install --no-cache-dir \
11-
fastapi>=0.104.0 \
12-
"uvicorn[standard]>=0.24.0" \
13-
requests>=2.25.0 \
14-
wsproto>=1.0.0 \
15-
gunicorn
9+
# Set the working directory
10+
WORKDIR /app
11+
12+
# Copy requirements file and install dependencies. This is done in a separate
13+
# step to leverage Docker's layer caching. Dependencies are only re-installed
14+
# when the requirements.txt file changes.
15+
COPY src/envs/dipg_safety_env/server/requirements.txt .
16+
RUN pip install --no-cache-dir -r requirements.txt
1617

1718
# Set the working directory and PYTHONPATH inside the container
1819
WORKDIR /app
@@ -31,4 +32,4 @@ HEALTHCHECK --interval=60s --timeout=10s --start-period=180s --retries=3 \
3132

3233

3334
# Note: The DIPG_DATASET_PATH must be provided when running this container.
34-
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000", "envs.dipg_safety_env.server.app:app"]
35+
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000", "envs.dipg_safety_env.server.app:app"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fastapi==0.104.0
2+
uvicorn[standard]==0.24.0
3+
requests==2.25.0
4+
wsproto==1.0.0
5+
gunicorn==22.0.0

0 commit comments

Comments
 (0)