Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python image as the base image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy the current directory contents to the container
|
| 8 |
+
COPY . /app
|
| 9 |
+
|
| 10 |
+
# Install required system dependencies (optional, modify as needed)
|
| 11 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
+
git && \
|
| 13 |
+
rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies from requirements.txt (if available)
|
| 16 |
+
# Create a requirements.txt file with all necessary packages
|
| 17 |
+
RUN pip install --no-cache-dir notebook pandas mlflow
|
| 18 |
+
|
| 19 |
+
# Expose the default Jupyter Notebook port
|
| 20 |
+
EXPOSE 8888
|
| 21 |
+
|
| 22 |
+
# Add a runtime argument for authentication (optional)
|
| 23 |
+
ARG CR_PAT
|
| 24 |
+
ARG USERNAME
|
| 25 |
+
|
| 26 |
+
# Default command to run the Jupyter Notebook
|
| 27 |
+
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
|