Sign inSign up

nandsachita/js-runtime

By nandsachita

Updated over 1 year ago

A lightweight Ubuntu 24.04-based Docker image with Node.js, Bun, and Deno pre-installed.

Image
Languages & frameworks
API management
Web servers
0

284

nandsachita/js-runtime repository overview

JavaScript Runtime Environment Docker Image

A lightweight Docker image that includes multiple JavaScript/TypeScript runtime environments (Node.js, Bun, and Deno) built on Ubuntu 24.04.

Features

  • Node.js LTS with npm
  • Bun runtime and package manager
  • Deno runtime
  • Built on Ubuntu 24.04
  • Common development tools (git, curl, wget, unzip)

Usage

Pull the image:

docker pull nandsachita/js-runtime

Run a container:

docker run -it nandsachita/js-runtime

Building Your Application

Node.js Application
FROM nandsachita/js-runtime

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY . .

# Build if needed
RUN npm run build

EXPOSE 3000
CMD ["npm", "start"]
Bun Application
FROM nandsachita/js-runtime

WORKDIR /app

# Copy package files
COPY package.json bun.lockb ./

# Install dependencies
RUN bun install

# Copy source code
COPY . .

# Build if needed
RUN bun run build

EXPOSE 3000
CMD ["bun", "start"]
Deno Application
FROM nandsachita/js-runtime

WORKDIR /app

# Copy dependency file if you have one
COPY deno.json deno.lock ./

# Cache dependencies
RUN deno cache deps.ts

# Copy source code
COPY . .

EXPOSE 8000
CMD ["deno", "run", "--allow-net", "main.ts"]
Next.js Application
FROM nandsachita/js-runtime

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY . .

# Build the application
RUN npm run build

EXPOSE 3000
CMD ["npm", "start"]
Building Multi-stage Example
# Build stage
FROM nandsachita/js-runtime AS builder

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Production stage
FROM nandsachita/js-runtime

WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY package*.json ./
RUN npm install --production

EXPOSE 3000
CMD ["npm", "start"]

Available Runtime Versions

  • Node.js: Latest LTS version
  • Bun: Latest stable version
  • Deno: Latest stable version

Environment Variables

The following environment variables are pre-configured:

  • DEBIAN_FRONTEND=noninteractive
  • PATH includes Bun and Deno binaries

Working Directory

The default working directory is set to /app

Examples

Running Node.js
docker run -it nandsachita/js-runtime node
Running Bun
docker run -it nandsachita/js-runtime bun
Running Deno
docker run -it nandsachita/js-runtime deno
Running with Volume Mount
docker run -it -v $(pwd):/app nandsachita/js-runtime

Development

Build the image locally:

docker build -t nandsachita/js-runtime .

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

Support

For support, please open an issue on the GitHub repository.

Author

Sachita Nand

Tags

  • latest: Ubuntu 24.04 with latest versions of Node.js LTS, Bun, and Deno

Tag summary

Content type

Image

Digest

sha256:c4ca6023f

Size

215.9 MB

Last updated

over 1 year ago

docker pull nandsachita/js-runtime