jupyter-docker / Dockerfile
khulnasoft's picture
Update Dockerfile
9bdf8c1 verified
raw
history blame
767 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 8888 for Jupyter Lab
EXPOSE 8888
# Expose port 5000 for Flask
EXPOSE 5000
# Define environment variable
ENV NAME HuggingFaceSpace
ENV JUPYTER_RUNTIME_DIR /tmp/.jupyter
# Run the command to start Jupyter Lab and Flask
CMD ["sh", "-c", "jupyter lab --ip=0.0.0.0 --port=8888 --allow-root & python app.py"]