likhonsheikhdev commited on
Commit
bd6cd03
·
verified ·
1 Parent(s): 8ff35aa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -0
Dockerfile ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # Prevent interactive prompts during package installation
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # Update package list and install essential tools
7
+ RUN apt-get update && apt-get install -y \
8
+ curl \
9
+ wget \
10
+ git \
11
+ vim \
12
+ nano \
13
+ htop \
14
+ tree \
15
+ unzip \
16
+ build-essential \
17
+ python3 \
18
+ python3-pip \
19
+ nodejs \
20
+ npm \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
+ # Create a non-root user for security
24
+ RUN useradd -m -s /bin/bash sandbox && \
25
+ usermod -aG sudo sandbox && \
26
+ echo "sandbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
27
+
28
+ # Set working directory
29
+ WORKDIR /home/sandbox
30
+
31
+ # Copy configuration files
32
+ COPY sandbox.yml /home/sandbox/
33
+ COPY tools.json /home/sandbox/
34
+
35
+ # Install Python packages commonly used in sandboxes
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
+ # Default command
56
+ CMD ["/bin/bash"]