Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a lightweight base image with Python
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Install git and git-lfs for cloning large models
|
5 |
+
RUN apt-get update && apt-get install -y git git-lfs
|
6 |
+
|
7 |
+
# Initialize git-lfs
|
8 |
+
RUN git-lfs install
|
9 |
+
|
10 |
+
# Set the working directory
|
11 |
+
WORKDIR /app
|
12 |
+
|
13 |
+
# Clone the Hugging Face model repository (replace with the desired model URL)
|
14 |
+
RUN git clone https://huggingface.co/matsant01/STEMerald-2b /app/model
|
15 |
+
|
16 |
+
# Install necessary Python libraries
|
17 |
+
COPY requirements.txt .
|
18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
+
|
20 |
+
# Copy the application code
|
21 |
+
COPY . .
|
22 |
+
|
23 |
+
# Expose the app port (if using FastAPI or another web server)
|
24 |
+
EXPOSE 8000
|
25 |
+
|
26 |
+
# Command to run the FastAPI server
|
27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|