> ## Documentation Index
> Fetch the complete documentation index at: https://shivamgoyal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Docker Setup

> Run CodeNull AI Backend locally using Docker

# 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:

```bash theme={null}
docker build --tag codenull-ai-backend .
```

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:

```bash theme={null}
docker run -d --name codenull-ai-backend -p 8000:8000 codenull-ai-backend
```

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](http://localhost:8000).

## Checking Container Status

To verify that your container is running:

```bash theme={null}
docker ps
```

This command lists all running containers. Look for `codenull-ai-backend` in the list.

## Viewing Container Logs

To see the logs from your container:

```bash theme={null}
docker logs codenull-ai-backend
```

Add the `-f` flag to follow the logs in real-time:

```bash theme={null}
docker logs -f codenull-ai-backend
```

## Stopping the Container

When you're done, you can stop the container:

```bash theme={null}
docker stop codenull-ai-backend
```

And remove it:

```bash theme={null}
docker rm codenull-ai-backend
```

## Accessing the API

With the container running, you can access:

* API documentation at [http://localhost:8000/docs](http://localhost:8000/docs)
* Health check endpoint at [http://localhost:8000/health](http://localhost:8000/health)

## Next Steps

After successfully running the application locally:

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference">
    Explore all available API endpoints and documentation
  </Card>

  <Card title="Azure Container Apps" icon="cloud" href="/deployment/azure-container-apps">
    Deploy your application to Azure Cloud
  </Card>

  <Card title="Production Deployment" icon="rocket" href="/deployment/production-deployment">
    Learn how to prepare for production environments
  </Card>

  <Card title="Monitoring" icon="chart-line" href="/deployment/monitoring">
    Set up monitoring for your deployed application
  </Card>
</CardGroup>
