Create DOCKERFILE
Browse files- DOCKERFILE +25 -0
DOCKERFILE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a Python base image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Install git to clone the repo
|
| 8 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Clone the repository into the current directory
|
| 11 |
+
RUN git clone https://github.com/koo1140/OpenAgent .
|
| 12 |
+
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# Create a user to avoid running as root (HF requirement/best practice)
|
| 17 |
+
RUN useradd -m -u 1000 user
|
| 18 |
+
USER user
|
| 19 |
+
ENV HOME=/home/user \
|
| 20 |
+
PATH=/home/user/.local/bin:$PATH
|
| 21 |
+
|
| 22 |
+
# Override the port using an Environment Variable or Command Line Argument
|
| 23 |
+
# Since the script has hardcoded port=8000, we run it via the uvicorn CLI
|
| 24 |
+
# to bypass the main.py hardcoding.
|
| 25 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|