Files
gancio/docs/install/docker.md

85 lines
2.2 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}
2022-01-26 15:38:53 +01:00
## Setup
2021-07-08 22:50:21 +02:00
2022-01-26 15:38:53 +01:00
Make sure to have [Docker Engine](https://docs.docker.com/engine/install/),
[Docker Compose](https://docs.docker.com/compose/install/) and [nginx](https://nginx.org/en/docs/install.html) installed:
2021-10-25 11:09:10 +02:00
```bash
sudo apt install docker docker-compose nginx
```
2021-07-08 22:50:21 +02:00
2022-01-26 15:38:53 +01: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
```
2022-01-26 15:38:53 +01:00
Download `Dockerfile` and `entrypoint.sh`:
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 %}
2019-09-24 11:46:11 +02:00
```
2022-01-26 15:38:53 +01:00
Download `docker-compose.yml` choosing your preferred database dialect between `sqlite`, `postgres` and `mariadb`:
2019-08-06 01:12:05 +02:00
```bash
2022-01-26 15:38:53 +01:00
DB=sqlite
wget {{site.url}}/docker/$DB/docker-compose.yml
2019-08-06 01:12:05 +02:00
```
2022-01-26 15:38:53 +01:00
Build docker image
```bash
2019-09-25 14:38:16 +02:00
docker-compose build
2019-07-17 00:41:08 +02:00
```
2019-09-24 11:46:11 +02:00
## Start gancio
2019-07-17 00:41:08 +02:00
2022-01-26 15:38:53 +01:00
Start your container:
2019-07-17 00:41:08 +02:00
```bash
docker-compose up -d
```
2022-01-26 15:38:53 +01:00
You can take a look at logs using:
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
```
2022-01-26 15:38:53 +01:00
You'll need to [setup nginx as a proxy]({% link install/nginx.md %}) then you can point your web browser to your domain :tada:
2019-08-06 01:12:05 +02:00
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
2021-07-08 15:56:09 +00:00
```