@cloudflare/sandbox 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @cloudflare/sandbox
2
2
 
3
+ ## 0.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#20](https://github.com/cloudflare/sandbox-sdk/pull/20) [`f106fda`](https://github.com/cloudflare/sandbox-sdk/commit/f106fdac98e7ef35677326290d45cbf3af88982c) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - add preview URLs and dynamic port forwarding
8
+
9
+ ## 0.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`60af265`](https://github.com/cloudflare/sandbox-sdk/commit/60af265d834e83fd30a921a3e1be232f13fe24da) Thanks [@threepointone](https://github.com/threepointone)! - update dependencies
14
+
3
15
  ## 0.0.7
4
16
 
5
17
  ### Patch Changes
package/Dockerfile CHANGED
@@ -1,16 +1,93 @@
1
- # syntax=docker/dockerfile:1
1
+ # Sandbox base image with development tools, Python, Node.js, and Bun
2
+ FROM ubuntu:22.04
2
3
 
3
- FROM oven/bun:latest
4
- # Set destination for COPY
4
+ # Prevent interactive prompts during package installation
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install essential system packages and development tools
8
+ RUN apt-get update && apt-get install -y \
9
+ # Basic utilities
10
+ curl \
11
+ wget \
12
+ git \
13
+ unzip \
14
+ zip \
15
+ # Process management
16
+ procps \
17
+ htop \
18
+ # Build tools
19
+ build-essential \
20
+ pkg-config \
21
+ # Network tools
22
+ net-tools \
23
+ iputils-ping \
24
+ dnsutils \
25
+ # Text processing
26
+ jq \
27
+ vim \
28
+ nano \
29
+ # Python dependencies
30
+ python3.11 \
31
+ python3.11-dev \
32
+ python3-pip \
33
+ # Other useful tools
34
+ sudo \
35
+ ca-certificates \
36
+ gnupg \
37
+ lsb-release \
38
+ && rm -rf /var/lib/apt/lists/*
39
+
40
+ # Set Python 3.11 as default python3
41
+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
42
+
43
+ # Install Node.js 22 LTS
44
+ # Using the official NodeSource repository setup script
45
+ RUN apt-get update && apt-get install -y ca-certificates curl gnupg \
46
+ && mkdir -p /etc/apt/keyrings \
47
+ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
48
+ && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
49
+ && apt-get update \
50
+ && apt-get install -y nodejs \
51
+ && rm -rf /var/lib/apt/lists/*
52
+
53
+ # Install Bun using the official installation script
54
+ RUN curl -fsSL https://bun.sh/install | bash \
55
+ && mv /root/.bun/bin/bun /usr/local/bin/bun \
56
+ && mv /root/.bun/bin/bunx /usr/local/bin/bunx \
57
+ && rm -rf /root/.bun
58
+
59
+ # Install global npm packages as root
60
+ RUN npm install -g yarn pnpm
61
+
62
+ # Create a non-root user for running applications
63
+ RUN useradd -m -s /bin/bash sandbox \
64
+ && echo "sandbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
65
+
66
+ # Set up working directory
5
67
  WORKDIR /app
6
68
 
7
- # Install git
8
- RUN apt-get update && apt-get install -y git
69
+ # Set ownership of the app directory to sandbox user
70
+ RUN chown -R sandbox:sandbox /app
71
+
72
+ # Set environment variables
73
+ ENV PATH="/home/sandbox/.local/bin:${PATH}"
74
+
75
+ # Switch to non-root user
76
+ USER sandbox
9
77
 
10
- COPY container_src/* ./
11
- # RUN bun install
78
+ # Verify installations
79
+ RUN python3 --version && \
80
+ node --version && \
81
+ npm --version && \
82
+ bun --version && \
83
+ yarn --version && \
84
+ pnpm --version
12
85
 
86
+ # Copy container source files
87
+ COPY --chown=sandbox:sandbox container_src/* ./
88
+
89
+ # Expose the application port
13
90
  EXPOSE 3000
14
- # Run
15
- CMD ["bun", "index.ts"]
16
91
 
92
+ # Run the application
93
+ CMD ["bun", "index.ts"]