Files
gancio/docs/install/docker.md

99 lines
2.5 KiB
Markdown
Raw Normal View History

---
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
---
2021-06-04 15:52:35 +02:00
## Docker installation
{: .no_toc }
2019-09-24 11:46:11 +02:00
1. TOC
{:toc}
## Initial setup
2021-06-04 15:34:40 +02:00
> info "Clone not needed"
> You do not need to clone the full repo, a `Dockerfile` and a `docker-compose.yml` are enough.
- __Create a directory where everything related to gancio is stored__
2019-07-17 00:41:08 +02:00
```bash
2021-06-04 15:34:40 +02:00
mkdir -p /opt/gancio/data
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
2019-09-25 14:38:16 +02:00
wget https://gancio.org/docker/Dockerfile
wget https://gancio.org/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
2019-09-25 14:38:16 +02:00
wget https://gancio.org/docker/Dockerfile
2019-09-26 17:02:09 +02:00
wget https://gancio.org/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
```
2019-08-06 01:12:05 +02:00
1. [Setup nginx as a proxy](/install/nginx)
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 15:34:40 +02:00
1. Edit `data/config.json` and restart the container on your needs, see [Configuration](/config) 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.
> Don't be lazy and [backup](/backup) your data!
> 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`
> 1. [Backup your data](/backup)
> 1. Download new `Dockerfile` <br/> `wget https://gancio.org/docker/Dockerfile`
> 1. Download new `docker-compose.yml` (substitute \<DB\> to sqlite or postgres): <br/>`wget https://gancio.org/docker/<DB>/docker-compose.yml`
> 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
```