# Installation

### Tags and Versions

{% hint style="success" %}
Images available in amd64 and arm64 under the same tag name. (v2.6.0 and upward)
{% endhint %}

Docker images use the following tagging conventions:

* **Version-specific tags (English):** `:v2.4.1`
* **Version-specific tags (other languages):** `:v2.4.1-fr`

  > Refer to the table below to find the earliest available version in your language.
* **Latest version (English):** `:latest`
* **Latest version (other languages):** `:latest-fr`

  > Use these tags to always pull the most up-to-date image in the desired language, if available.

| Language | Code    | Earliest Available Version |
| -------- | ------- | -------------------------- |
| English  | DEFAULT | ALL VERSIONS               |
| French   | fr      | v2.4.1                     |
| Dutch    | nl      | v2.4.3                     |
| Swedish  | sv      | v2.4.3                     |

{% hint style="info" %}
For more detailed information regarding the Dockerfile, please review the inline comments available in the GitHub repository.
{% endhint %}

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

For additionnal customization, see [Gunicorn Parameters](https://gift.icbest.ca/environnement-variables#docker-gunicorn-variables)

Now head to [setup](https://gift.icbest.ca/getting-started/setup) 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 --name giftmanager 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.

For additionnal customization, see [Gunicorn Parameters](https://gift.icbest.ca/environnement-variables#docker-gunicorn-variables)

Now head to [setup](https://gift.icbest.ca/getting-started/setup) 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 deploy in production with [Gunicorn](https://gunicorn.org/). You can access on port 80.

```
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 ](https://gift.icbest.ca/getting-started/setup)and follow the steps
