add dokku 1st part
This commit is contained in:
parent
e4f39bf7ec
commit
5ace0fa738
71
docs/divers/devops/dokku.md
Normal file
71
docs/divers/devops/dokku.md
Normal 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`).
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
```
|
||||
|
||||
@ -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 %}
|
||||
```
|
||||
BIN
docs/divers/devops/img/dokku-setup.png
Normal file
BIN
docs/divers/devops/img/dokku-setup.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user