Skip to main content

Local Development with Docker

This guide covers how to set up and run the CodeNull AI Backend locally using Docker for development and testing.

Building the Docker Image

To create a Docker image from your CodeNull AI Backend source code:
This command builds a Docker image with the tag codenull-ai-backend using the Dockerfile in the current directory.

Running the Container Locally

Once you’ve built the image, you can run it as a container:
This command:
  • Creates a container named codenull-ai-backend
  • Maps port 8000 on your host to port 8000 in the container
  • Runs the container in detached mode (-d)
After running this command, your application will be accessible at http://localhost:8000.

Checking Container Status

To verify that your container is running:
This command lists all running containers. Look for codenull-ai-backend in the list.

Viewing Container Logs

To see the logs from your container:
Add the -f flag to follow the logs in real-time:

Stopping the Container

When you’re done, you can stop the container:
And remove it:

Accessing the API

With the container running, you can access:

Next Steps

After successfully running the application locally:

API Reference

Explore all available API endpoints and documentation

Azure Container Apps

Deploy your application to Azure Cloud

Production Deployment

Learn how to prepare for production environments

Monitoring

Set up monitoring for your deployed application