Code-agent-v1 / Dockerfile
nakas's picture
Update Dockerfile
2694859 verified
raw
history blame
691 Bytes
FROM python:3.9-slim
WORKDIR /app
# Install dependencies
RUN pip install --no-cache-dir \
jupyter \
notebook \
ipywidgets \
numpy \
pandas \
matplotlib \
seaborn \
scikit-learn \
transformers \
torch \
gradio
# Create a non-root user to run Jupyter
RUN useradd -m jupyter
RUN mkdir -p /app/notebooks && chown -R jupyter:jupyter /app
# Copy files
COPY --chown=jupyter:jupyter welcome.ipynb /app/notebooks/
COPY --chown=jupyter:jupyter app.py /app/
COPY --chown=jupyter:jupyter run.sh /app/
# Make script executable
RUN chmod +x /app/run.sh
# Switch to non-root user
USER jupyter
# Expose port
EXPOSE 7860
# Start servers
CMD ["/app/run.sh"]