Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -10
Dockerfile
CHANGED
|
@@ -31,26 +31,30 @@ WORKDIR /home/sandbox
|
|
| 31 |
# Copy configuration files
|
| 32 |
COPY sandbox.yml /home/sandbox/
|
| 33 |
COPY tools.json /home/sandbox/
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
# Install Python packages
|
| 36 |
-
RUN pip3 install --no-cache-dir
|
| 37 |
-
jupyterlab \
|
| 38 |
-
fastapi \
|
| 39 |
-
uvicorn \
|
| 40 |
-
requests \
|
| 41 |
-
pandas \
|
| 42 |
-
numpy
|
| 43 |
|
| 44 |
# Create directories for projects and tools
|
| 45 |
RUN mkdir -p /home/sandbox/projects && \
|
| 46 |
mkdir -p /home/sandbox/tools && \
|
|
|
|
| 47 |
chown -R sandbox:sandbox /home/sandbox
|
| 48 |
|
| 49 |
# Switch to non-root user
|
| 50 |
USER sandbox
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# Expose common ports
|
| 53 |
EXPOSE 8000 8888 3000
|
| 54 |
|
| 55 |
-
#
|
| 56 |
-
CMD ["
|
|
|
|
| 31 |
# Copy configuration files
|
| 32 |
COPY sandbox.yml /home/sandbox/
|
| 33 |
COPY tools.json /home/sandbox/
|
| 34 |
+
COPY init.sh /home/sandbox/
|
| 35 |
+
COPY startup.py /home/sandbox/
|
| 36 |
+
COPY requirements.txt /home/sandbox/
|
| 37 |
|
| 38 |
+
# Install Python packages from requirements.txt
|
| 39 |
+
RUN pip3 install --no-cache-dir -r /home/sandbox/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
# Create directories for projects and tools
|
| 42 |
RUN mkdir -p /home/sandbox/projects && \
|
| 43 |
mkdir -p /home/sandbox/tools && \
|
| 44 |
+
chmod +x /home/sandbox/init.sh && \
|
| 45 |
chown -R sandbox:sandbox /home/sandbox
|
| 46 |
|
| 47 |
# Switch to non-root user
|
| 48 |
USER sandbox
|
| 49 |
|
| 50 |
+
# Set working directory to sandbox home
|
| 51 |
+
WORKDIR /home/sandbox
|
| 52 |
+
|
| 53 |
+
# Run initialization script
|
| 54 |
+
RUN /home/sandbox/init.sh
|
| 55 |
+
|
| 56 |
# Expose common ports
|
| 57 |
EXPOSE 8000 8888 3000
|
| 58 |
|
| 59 |
+
# Start the application server
|
| 60 |
+
CMD ["python3", "startup.py"]
|