> For the complete documentation index, see [llms.txt](https://data-programs.gitbook.io/singularity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://data-programs.gitbook.io/singularity/installation/deploy-to-production.md).

# Deploy to production

Singularity uses `sqlite3` as its default database backend due to its ease of setup. However, when transitioning to a production environment, especially if you're planning to use multiple workers or intend to serve retrievals behind a load balancer, it's recommended to switch to a more robust database backend. You can configure the backend by setting the `$DATABASE_CONNECTION_STRING` environment variable.

## Supported Database Backends

* **PostgreSQL**:\
  Connection String Example:\
  `postgres://user:pass@example.com:5432/dbname`
* **MySQL**:\
  Connection String Example:\
  `mysql://user:pass@tcp(localhost:3306)/dbname?parseTime=true`

## Using Docker Compose for Deployment

If you'd like to quickly deploy Singularity along with a PostgreSQL backend, consider using the provided Docker Compose template:

```bash
wget https://raw.githubusercontent.com/data-preservation-programs/singularity/main/docker-compose.yml
docker-compose up
```

Executing the above commands will set up a PostgreSQL database and launch the necessary Singularity services, including the API and a dataset worker.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://data-programs.gitbook.io/singularity/installation/deploy-to-production.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
