Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official lightweight Python image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Hugging Face Spaces require running as a non-root user
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
|
| 8 |
+
# Set environment variables for the user and ChromaDB config
|
| 9 |
+
ENV HOME=/home/user \
|
| 10 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 11 |
+
CHROMA_HOST=vish85521-chromadb.hf.space \
|
| 12 |
+
CHROMA_PORT=443 \
|
| 13 |
+
CHROMA_SSL=True
|
| 14 |
+
|
| 15 |
+
# Set the working directory
|
| 16 |
+
WORKDIR $HOME/app
|
| 17 |
+
|
| 18 |
+
# Copy the requirements file and install dependencies
|
| 19 |
+
COPY --chown=user requirements.txt $HOME/app/
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Copy the rest of the application code
|
| 23 |
+
COPY --chown=user . $HOME/app
|
| 24 |
+
|
| 25 |
+
# Expose the default port for Hugging Face Spaces
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# Run the Streamlit application
|
| 29 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|