# With Nginx and MongoDB

## Overview

This deployment is based on two docker images:

1. <https://hub.docker.com/r/faloker/purify-api>
2. <https://hub.docker.com/r/faloker/purify-nginx>
   1. serve static files (vue frontend)
   2. provide https
   3. serve files over http2
3. <https://hub.docker.com/_/mongo> (if you want local mongodb)

## Local setup

To start the Purify locally without certificates and other production things, you can do the following:

1. Clone repository
2. Run `docker-compose -f docker-compose.tests.yml up --build`

## Configuration

### docker-compose

Before deployment you may want to configure a few things in docker-compose file

```
// ./docker-compose.yml

// if you want local mongodb
mongo:
...
environment:
  MONGO_INITDB_ROOT_USERNAME: root
  MONGO_INITDB_ROOT_PASSWORD: example


// update local path to the .env file (see api/.env.example)
api:
...
env_file:
  - .env.custom


// update local paths to certificate and key files
nginx:
...
volumes:
      - /path/to/cert:/etc/nginx/ssl/cert
      - /path/to/key:/etc/nginx/ssl/key
      - ./nginx.prod.conf:/etc/nginx/nginx.conf
```

### nginx

You can edit nginx config file to adjust it for your needs. There is a config [example](https://github.com/faloker/purify/blob/master/nginx/nginx.prod.conf) which is used by default, but in order to use it, you will need to change [server\_name](https://github.com/faloker/purify/blob/master/nginx/nginx.prod.conf#L25) options.

## Start

```
docker-compose up -d
```


---

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

```
GET https://faloker.gitbook.io/purify/deployment/with-nginx-and-mongodb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
