🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

DIY Deployment ​

WARNING

This page suggests a deployment option that is far from ideal of running agents at scale.

However, if you're eager to deploy your agents, you can bundle the development server and run your project for testing purposes today.

We recommend using Sagentic Platform for production deployments. Learn how to deploy your project on Sagentic Platform.

If you still want to run your agents containerized, consider using monk.io. Learn how to deploy your project with monk.io.

Containerization is a popular and effective way to ensure consistent deployments. With Docker, you can package your Sagentic project along with its environment into a container that can be deployed anywhere Docker is supported. Here's how to get started.

Creating a Dockerfile ​

To containerize your Sagentic project, you'll need a Dockerfile. This file contains all the commands a user could call on the command line to assemble an image. Here's a basic Dockerfile for a Node.js application:

Dockerfile
# Use an official Node runtime as a parent image
FROM node:20.11.0

# Set the working directory in the container to /app
WORKDIR /app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install any needed packages specified in package.json
RUN npm install

# Copy the current directory contents into the container at /app
COPY . .

# Make port 3000 available to the world outside this container
EXPOSE 3000

# Compile the project
RUN npm run build

# Run the app when the container launches
CMD ["npm", "run", "dev"]

Place this Dockerfile in the root of your Sagentic project.

Building the Docker Image ​

With the Dockerfile in place, you can build the Docker image using the following command:

bash
docker build -t your-username/sagentic-project-name .

Replace your-username with your Docker Hub username and sagentic-project-name with the name of your project.

Running Your Container ​

After building the image, you can run your Sagentic project as a container. Here's the command to start your container:

bash
docker run -p 3000:3000 your-username/sagentic-project-name

This command maps the port 3000 inside the container to port 3000 on your host machine, allowing you to access the development server.

Deployment Options ​

Once your Docker image is ready, you can deploy it to any service that supports Docker containers. Some popular options include:

Each platform has its own set of instructions for deploying Docker containers, so be sure to check out their documentation for specific guidance.

Containerizing your Sagentic project with Docker is a reliable way to achieve consistent deployments across different environments. With your Dockerfile set up and your image built, you're ready to deploy your autonomous agents to the cloud for testing purposes.