/bolt.new-ai-integrations

Bolt.new AI and Docker integration: Step-by-Step Guide 2025

Learn how to seamlessly integrate Bolt.new AI with Docker using step-by-step instructions and best practices to optimize your containerized AI workflow.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Bolt.new AI with Docker?

 

Setting Up Your TypeScript Server

 
  • Create (or open) your main TypeScript file (for example, server.ts) in your Bolt.new AI project.
  • Paste the following code snippet into server.ts. This code sets up an Express server that listens on a configurable port using the environment variable PORT (which Docker can set) or defaults to 3000:
  • 
    import express from 'express';
    
    

    const app = express();
    const port = process.env.PORT || 3000;

    app.get('/', (req, res) => {
    res.send('Hello from Bolt.new AI integrated with Docker!');
    });

    app.listen(port, '0.0.0.0', () => {
    console.log(Server is running on port ${port});
    });



  • Ensure that your project compiles TypeScript to JavaScript (usually into a dist directory) using the TypeScript compiler (tsc).

 

Creating the Dockerfile

 
  • Create a new file in the root directory of your project and name it Dockerfile.
  • Paste the following content into the Dockerfile. This file tells Docker how to build your application’s image:
  • 
    Use an official Node.js runtime as a parent image
    FROM node:18-alpine
    
    

    Set the working directory in the container
    WORKDIR /app

    Copy package.json and package-lock.json (if available)
    COPY package*.json ./

    Install dependencies
    RUN npm install

    Copy the rest of your application's source code
    COPY . .

    If you have a build step, uncomment the following line:
    RUN npm run build

    Expose the port on which your app will run
    EXPOSE 3000

    Define the command to run your app
    CMD ["npm", "start"]



  • This configuration uses a lightweight Node.js image, installs dependencies, copies your code, and starts your application. The app listens on port 3000 which is exposed from the container.

 

Configuring Package.json for Docker

 
  • Open your package.json file (or create one if it doesn’t exist) in the root of your project.
  • Add or update the scripts section to include commands for building and running your Docker image. This is useful because Bolt.new AI projects do not expose a terminal; you will simply include these commands as part of your project documentation for later use:
  • 
    {
      "name": "bolt-ai-docker",
      "version": "1.0.0",
      "main": "server.js",
      "scripts": {
        "build": "tsc",
        "start": "node dist/server.js",
        "docker:build": "docker build -t bolt-ai-docker .",
        "docker:run": "docker run -p 3000:3000 bolt-ai-docker"
      },
      "dependencies": {
        "express": "^4.18.2"
      },
      "devDependencies": {
        "@types/express": "^4.17.15",
        "typescript": "^4.9.5"
      }
    }
        
  • Adjust the build and start commands if your project uses a different structure or build process.

 

Running Your Application in Docker

 
  • Since Bolt.new AI does not offer a terminal, you must use the provided code modifications and configuration files as your Docker integration setup.
  • When you have access to a terminal (for example, on your local machine), run the command specified in the docker:build script to build your Docker image:
  • 
    npm run docker:build
        
  • After building the image, run the container with the mapped port using the command from the docker:run script:
  • 
    npm run docker:run
        
  • This setup ensures your app listens on 0.0.0.0:3000 inside the container, and Docker maps it to your host’s port 3000.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022