add dokku 1st part

This commit is contained in:
makayabou 2020-12-15 04:21:00 +01:00
parent e4f39bf7ec
commit 5ace0fa738
5 changed files with 74 additions and 1 deletions

View File

@ -0,0 +1,71 @@
# Dokku
[Dokku](http://dokku.viewdocs.io/dokku/) is an open-source Heroku-like, that helps you manage and deploy web applications.
## Installation
As of debian user we can install with apt
```
# install prerequisites
sudo apt update -qq >/dev/null
sudo apt install -qq -y apt-transport-https
# install docker
wget -nv -O - https://get.docker.com/ | sh
# install dokku
wget -nv -O - https://packagecloud.io/dokku/dokku/gpgkey | sudo apt-key add -
OS_ID="$(lsb_release -cs 2>/dev/null || echo "bionic")"
echo "xenial bionic focal" | grep -q "$OS_ID" || OS_ID="bionic"
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt update -qq >/dev/null
sudo apt install -qq -y dokku
sudo dokku plugin:install-dependencies --core
```
When asked, you can accept web page front end installation.
### Configure your host
If you are using a domain provider, make sure to create an A record in your DNS table,
pointing to your server's Ip.
If you are deploying dokker on your local machine (for testing purpose), you will need to modify `/etc/hosts` AND use `dnsmasq` ( Replace `<dokku.local>` by the domain name of your choice).
1. modify first line of `/etc/hosts` :
```
127.0.0.1 localhost <dokku.local>
```
2. `sudo apt install dnsmasq`
3. `sudo systemctl enable dnsmasq`
4. Add `address=/<dokku.local>/127.0.0.1` in `/etc/dnsmasq.conf`
5. Reboot your computer
### Configure ssh
Configure a public/private key pair for ssh root access.
Run following commands as root:
1. As root, run `ssh-keygen`
2. Copy the key to authorized keys for dokku:
```
cat ~/.ssh/id_rsa.pub |sshcommand acl-add dokku superuser
```
3. In setup webpage at `http://<dokku.local>`, paste content from `/root/.ssh/id_rsa.pub` (only the part with `ssh-rsa`).
![Screenshot of dokku setup webpage](img/dokku-setup.png)
## Create app
```
git clone https://github.com/heroku/python-getting-started
dokku apps:create python-getting-started
dokku postgres:create djangodatabase
dokku postgres:link djangodatabase python-getting-started
cd python-getting-started/
git checkout -b master
git remote add dokku dokku@dokku.talkie.social:django.dokku.talkie.social
sudo git push dokku master
```

View File

@ -48,5 +48,5 @@ Pour l'exemple, nous choisissons de créer la page `Présentation`.
Nous allons créer un template
```html
{{ .Content }}
{% raw %}{{ .Content }}{% endraw %}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -3,3 +3,4 @@
- [Utiliser Hugo, un Générateur de Sites Statiques (SGG) en Go](hugo/index.md)
- [Keycloak as SSO for Nextcloud](sso/index.md)
- [Utiliser Gitpod avec Gitlab](gitpod.md)
- [Utiliser Dokku pour déployer des applis en mode PaaS](dokku.md)

View File

@ -115,6 +115,7 @@ nav:
- divers/devops/sso/sso-mattermost.md
- divers/devops/sso/sso-wordpress.md
- "Gitpod": divers/devops/gitpod.md
- "Dokku": divers/devops/dokku.md
- "Interne":
- "Index": divers/internal/index.md
- "Imprimantes": divers/internal/install-printers.md