> For the complete documentation index, see [llms.txt](https://gift.icbest.ca/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gift.icbest.ca/giftmanager-docs/getting-started/install.md).

# Installation

### Docker Compose

You can use the docker image on the docker hub. It is using the same latest code as the folder "Docker" on the Github repo.

[icbest/giftmanager](https://hub.docker.com/r/icbest/giftmanager)

To use Docker Compose, copy, on your machine, the file [docker-compose.yml](https://github.com/icbestCA/giftmanager/blob/main/docker-compose.yml) from the repo.

You will need to edit the volume path to keep your data files in the correct folder.

```
volumes:
      - C:/Users/user1/documents/data:/app/data/
```

Modify only this part `C:/Users/user1/documents/data` to mount the folder on your machine.

When updating, keep the files where they are and just create a new container but mount it to the same folder on the host machine.

Edit the port you want to expose on the web.

```
ports:
      - "[port]:5000"
```

To run the container enter the directory of your docker-compose.yml file then in the terminal execute the following command:&#x20;

```
docker compose up -d && docker compose logs -f
```

You should see the image being pulled and the flask app being started.

Now head to [setup](/giftmanager-docs/getting-started/setup.md) and follow the steps to configure the app.

### Docker Run

You can use the docker image on the docker hub. It is using the same latest code as the folder "Docker" on the Github repo.

[icbest/giftmanager](https://hub.docker.com/r/icbest/giftmanager)&#x20;

Run the following command to run the container:

```
docker run -p [published-port]:5000 -d -v /path/to/data:/app/data icbest/giftmanager 
```

Change the port on which you want to access, making the command like that:  80:5000  you could now access on port 80 in browser.

**Make sure** to add a path so the app can store the data on the host machine like that:&#x20;

Linux: `/root/data:/app/data`

Windows: `C:/Users/user1/documents/data:/app/data`

When updating, keep the files where they are and just create a new container but mount it to the same folder on the host machine.

Now head to [setup](/giftmanager-docs/getting-started/setup.md) and follow the steps to configure the app.

### Python Gunicorn (Linux Only)

**Make sure you have latest Python installed and Pip.**

1. Download the app folder in the [main repository](https://github.com/icbestCA/giftmanager).
2. Make sure to put the folder is unzipped and in a directory that make sense to you.
3. Inside the main directory, install requirements.txt with the following command:

```
pip install -r requirements.txt
```

4. Still inside the `app.py` directory run the command bellow to make sure everything is working and see the errors messages if any. You can access on port 5000

```
flask run --host=0.0.0.0
```

5. If everything run fine, you can deploy in production with [Gunicorn](https://gunicorn.org/).

```
gunicorn app:app -w 1 --threads 4 -b 0.0.0.0:80 
```

Here the command `-w 1` : The number of workers, i recommend on 1 because using a json database it does some glitch with multiple workers. For faster loading time we use 4 threads which remains on one workers to prevent glitches. `-b 0.0.0.0:80`: The publish port, use port 80 so you can access it on default http. `app:app`: Define the file for the app.py .

6. Go to [setup ](/giftmanager-docs/getting-started/setup.md)and follow the steps
