The codjix/aio:bun image provides a lightweight container for running applications with the Bun JavaScript runtime. This image is built on top of the AIO base image and includes the Bun runtime environment.
# Start a Bun REPL
docker run -it --name aio-bun codjix/aio:bun
# Run a Bun script
docker run -it --name aio-bun -v $(pwd):/app -w /app codjix/aio:bun bun run index.ts
docker run -d --name aio-bun-app -v $(pwd):/app -w /app -p 3000:3000 codjix/aio:bun bun run index.ts
BUN_RUNTIME_TRANSPILER_CACHE_PATH: Set to 0 by default to disable the runtime transpiler cacheBUN_INSTALL_BIN: Path for global bun installs, defaults to /usr/local/binMount your application code to any directory, commonly /app:
docker run -it -v $(pwd):/app -w /app codjix/aio:bun
To install and use dependencies with Bun:
# Install dependencies
docker run -it -v $(pwd):/app -w /app codjix/aio:bun bun install
# Run with dependencies
docker run -it -v $(pwd):/app -w /app codjix/aio:bun bun run start
version: '3'
services:
bun-app:
image: codjix/aio:bun
container_name: aio-bun-app
ports:
- "3000:3000"
volumes:
- ./app:/app
working_dir: /app
command: bun run index.ts
environment:
- NODE_ENV=development
- BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
The Dockerfile and associated scripts for this image are available in the src/bun directory of the AIO repository.