2019-07-12 23:20:55 +02:00
---
layout: default
title: Docker
2019-07-27 13:04:06 +02:00
permalink: /install/docker
parent: Install
2021-06-04 15:34:40 +02:00
nav_order: 2
2019-07-12 23:20:55 +02:00
---
2021-06-04 15:52:35 +02:00
## Docker installation
{: .no_toc }
2019-07-12 23:20:55 +02:00
2019-09-24 11:46:11 +02:00
1. TOC
{:toc}
## Initial setup
2019-07-12 23:20:55 +02:00
2021-06-04 15:34:40 +02:00
- __Create a directory where everything related to gancio is stored__
2019-07-17 00:41:08 +02:00
```bash
2021-07-01 10:56:12 +02:00
mkdir -p /opt/gancio
2019-07-17 00:41:08 +02:00
cd /opt/gancio
```
2019-09-24 11:46:11 +02:00
## Use sqlite
< div class = 'code-example bg-grey-lt-100' markdown = "1" >
1. **Download docker-compose.yml and Dockerfile**
2019-07-17 00:41:08 +02:00
```bash
2021-06-04 20:37:19 +02:00
wget {{site.url}}{% link /docker/Dockerfile %}
2021-07-01 10:56:12 +02:00
wget {{site.url}}{% link /docker/entrypoint.sh %}
2021-06-04 20:37:19 +02:00
wget {{site.url}}{% link /docker/sqlite/docker-compose.yml %}
2019-07-17 00:41:08 +02:00
```
2019-08-06 01:12:05 +02:00
2021-06-04 15:34:40 +02:00
1. Build docker image and launch interactive setup
2019-09-24 11:46:11 +02:00
```
2019-09-25 14:38:16 +02:00
docker-compose build
2019-09-24 11:46:11 +02:00
docker-compose run --rm gancio gancio setup --docker --db=sqlite
```
< / div >
## Use postgreSQL
< div class = 'code-example bg-grey-lt-100' markdown = "1" >
1. **Download docker-compose.yml and Dockerfile**
2019-08-06 01:12:05 +02:00
```bash
2021-06-04 20:37:19 +02:00
wget {{site.url}}{% link /docker/Dockerfile %}
2021-07-01 10:56:12 +02:00
wget {{site.url}}{% link /docker/entrypoint.sh %}
2021-06-04 20:37:19 +02:00
wget {{site.url}}{% link /docker/postgres/docker-compose.yml %}
2019-08-06 01:12:05 +02:00
```
2021-06-04 15:34:40 +02:00
1. Build docker image and launch interactive setup
2019-07-17 00:41:08 +02:00
```
2019-09-25 14:38:16 +02:00
docker-compose build
2019-09-25 19:09:15 +02:00
docker-compose run --rm gancio gancio setup --docker --db=postgres
2019-07-17 00:41:08 +02:00
```
2019-09-24 11:46:11 +02:00
< / div >
## Start gancio
2019-07-17 00:41:08 +02:00
1. Run your container
```bash
docker-compose up -d
```
2021-06-04 15:34:40 +02:00
1. Look at logs
2019-09-24 11:46:11 +02:00
```bash
2021-06-04 15:34:40 +02:00
tail -f data/logs/gancio.log
2019-09-24 11:46:11 +02:00
```
2021-06-20 23:10:20 +02:00
1. [Setup nginx as a proxy]({% link install/nginx.md %}
2019-07-17 00:41:08 +02:00
2019-07-27 13:04:06 +02:00
1. Point your web browser to [http://localhost:13120 ](http://localhost:13120 ) or where you specified during setup and enjoy :tada:
2019-08-06 01:12:05 +02:00
2021-06-04 20:37:19 +02:00
1. Edit `data/config.json` and restart the container on your needs, see [Configuration ]({% link install/configuration.md %} ) for more details.
2019-09-26 16:56:28 +02:00
## Upgrade
2021-06-04 15:34:40 +02:00
> warning "Backup your data"
> Backup your data is generally a good thing to do and this is especially true before upgrading.
2021-06-04 20:37:19 +02:00
> Don't be lazy and [backup]({% link install/backup.md %}) your data!
2021-06-04 15:34:40 +02:00
> error "Upgrade from a version < 1.0"
> Since v1.0 our docker setup is changed and a new container has to be built:
>
2021-06-04 15:52:35 +02:00
> 1. `cd /opt/gancio`
2021-06-04 20:37:19 +02:00
> 1. [Backup your data]({% link install/backup.md %})
> 1. Download new `Dockerfile` <br/> `wget {{site.url}}{% link /docker/Dockerfile %}`
2021-07-01 10:56:12 +02:00
> 1. Download new `entrypoint.sh` <br/> `wget {{site.url}}{% link /docker/entrypoint.sh %}`
2021-06-19 22:53:39 +02:00
> 1. Download new `docker-compose.yml` (substitute `sqlite` with `postgres` in case): <br/>`wget {{site.url}}{% link /docker/sqlite/docker-compose.yml %}`
2021-06-04 15:52:35 +02:00
> 1. Build the new container `docker-compose build`
> 1. Extract your backup into `./data` <br/>`mkdir data; tar xvzf gancio-<yourLastBackup>-backup.tgz -C data`
> 1. Stop your old container `docker-compose stop`
> 1. Start your new container `docker-compose up`
2021-06-04 15:34:40 +02:00
2019-09-26 16:56:28 +02:00
```bash
cd /opt/gancio
docker-compose up -d --no-deps --build
```