1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

struggling with links

This commit is contained in:
Nicolas Florentin 2017-07-20 17:42:55 +02:00
parent aa4ef99d02
commit 48a5b45e06

View File

@ -6,37 +6,34 @@ In order to make it work, please use the same directories structure as described
##### Table of contents ##### Table of contents
1. [Preliminary steps](#preliminary-steps)<br/> 1. [Preliminary steps](#preliminary-steps)<br/>
1.1. [docker/env file](#docker-env)<br/> 1.1. docker/env file<br/>
1.2. [docker/nginx_with_ssl.conf.example file](#nginx-conf)<br/> 1.2. docker/nginx_with_ssl.conf.example file<br/>
1.3. [setup the server](#setup-server)<br/> 1.3. setup the server<br/>
1.4. [buy a domain name and link it with the droplet](#buy-domain-link-droplet)<br/> 1.4. buy a domain name and link it with the droplet<br/>
1.5. [connect to the droplet via SSH](#connect-to-droplet)<br/> 1.5. connect to the droplet via SSH<br/>
1.6. [create SWAP file in coreOs](#create-swap-file)<br/> 1.6. create SWAP file in coreOs<br/>
1.7. [setup folders and env file](#setup-folders-env-file)<br/> 1.7. setup folders and env file<br/>
1.8. [SSL certificate with LetsEncrypt](#ssl-certificate-letsencrypt)<br/> 1.8. SSL certificate with LetsEncrypt<br/>
1.9. [install docker-compose](#install-docker-compose) 1.9. install docker-compose
2. [Deployment](#deployment)<br/> 2. [Deployment](#deployment)<br/>
2.1. [pull images](#pull-images)<br/> 2.1. pull images</br>
2.2. [setup database](#setup-database)<br/> 2.2. setup database</br>
2.3. [build assets](#build-assets)<br/> 2.3. build assets</br>
2.4. [prepare Elasticsearch (search engine)](#prepare-elastic)<br/> 2.4. prepare Elasticsearch (search engine)</br>
2.5. [start all services](#start-services) 2.5. start all services
3. [Generate SSL certificate by Letsencrypt](#generate-sll-cert-letsencrypt) 3. [Generate SSL certificate by Letsencrypt](#generate-sll-certificate-by-letsencrypt)
4. [Docker utils](#docker-utils) 4. [Docker utils](#docker-utils)
5. [Fabmanager update](#update-fabmanager)<br/> 5. [Fabmanager update](#fabmanager-update)<br/>
5.1. [Steps](#update-steps)<br/> 5.1. Steps<br/>
5.2. [Good to know](#good-to-know) 5.2. Good to know
<a id="preliminary-steps"></a>
## Preliminary steps ## Preliminary steps
<a id="docker-env"></a>
### docker/env file ### docker/env file
Make a copy of the **docker/env.example** file and use it as a starting point. Make a copy of the **docker/env.example** file and use it as a starting point.
Set all the environment variables needed by your application. Please refer to the [FabManager README](https://github.com/LaCasemate/fab-manager/blob/master/README.md) for explanations about those variables. Set all the environment variables needed by your application. Please refer to the [FabManager README](https://github.com/LaCasemate/fab-manager/blob/master/README.md) for explanations about those variables.
<a id="nginx-conf"></a>
### docker/nginx_with_ssl.conf.example file ### docker/nginx_with_ssl.conf.example file
* Replace **MAIN_DOMAIN** (example: fab-manager.com). * Replace **MAIN_DOMAIN** (example: fab-manager.com).
@ -45,27 +42,23 @@ Set all the environment variables needed by your application. Please refer to th
**Use nginx.conf.example if you don't want SSL for your app.** **Use nginx.conf.example if you don't want SSL for your app.**
<a id="setup-server"></a>
### setup the server ### setup the server
Go to [DigitalOcean](https://www.digitalocean.com/) and create a Droplet with operating system coreOS **stable**. Go to [DigitalOcean](https://www.digitalocean.com/) and create a Droplet with operating system coreOS **stable**.
You need at least 2GB of addressable memory (RAM + swap) to install and use FabManager. You need at least 2GB of addressable memory (RAM + swap) to install and use FabManager.
Choose a datacenter. Set the hostname as your domain name. Choose a datacenter. Set the hostname as your domain name.
<a id="buy-domain-link-droplet"></a>
### buy a domain name and link it with the droplet ### buy a domain name and link it with the droplet
1. Buy a domain name on [OVH](https://www.ovh.com/fr/) 1. Buy a domain name on [OVH](https://www.ovh.com/fr/)
2. Replace the IP address of the domain with the droplet's IP (you can enable the flexible ip and use it) 2. Replace the IP address of the domain with the droplet's IP (you can enable the flexible ip and use it)
3. **Do not** try to access your domain name right away, DNS are not aware of the change yet so **WAIT** and be patient. 3. **Do not** try to access your domain name right away, DNS are not aware of the change yet so **WAIT** and be patient.
<a id="connect-to-droplet"></a>
### connect to the droplet via SSH ### connect to the droplet via SSH
You can already connect to the server with this command: `ssh core@droplet-ip`. When DNS propagation will be done, you will be able to You can already connect to the server with this command: `ssh core@droplet-ip`. When DNS propagation will be done, you will be able to
connect to the server with `ssh core@your-domain-name`. connect to the server with `ssh core@your-domain-name`.
<a id="create-swap-file"></a>
### create SWAP file in coreOS ### create SWAP file in coreOS
Switch to sudo and create a swap file: Switch to sudo and create a swap file:
@ -104,7 +97,6 @@ systemctl start swap
exit exit
``` ```
<a id="setup-folders-env-file"></a>
### setup folders and env file ### setup folders and env file
Create the config folder: Create the config folder:
@ -126,7 +118,6 @@ Copy the previously customized `nginx_with_ssl.conf.example` as `/home/core/fabm
Copy the previously customized `nginx.conf.example` as `/home/core/fabmanager/config/nginx/fabmanager.conf` if you do not want to use ssl (not recommended !). Copy the previously customized `nginx.conf.example` as `/home/core/fabmanager/config/nginx/fabmanager.conf` if you do not want to use ssl (not recommended !).
<a id="ssl-certificate-letsencrypt"></a>
### SSL certificate with LetsEncrypt ### SSL certificate with LetsEncrypt
**FOLLOW THOSE INSTRUCTIONS ONLY IF YOU WANT TO USE SSL**. **FOLLOW THOSE INSTRUCTIONS ONLY IF YOU WANT TO USE SSL**.
@ -179,7 +170,6 @@ WantedBy=timers.target
That's all for the moment. Keep on with the installation, we'll complete that part after deployment in the [Generate SSL certificate by Letsencrypt](#generate-ssl-cert-letsencrypt). That's all for the moment. Keep on with the installation, we'll complete that part after deployment in the [Generate SSL certificate by Letsencrypt](#generate-ssl-cert-letsencrypt).
<a id="install-docker-compose"></a>
### Install docker-compose ### Install docker-compose
```bash ```bash
@ -191,17 +181,14 @@ sudo chmod +x /opt/bin/docker-compose
Then copy docker-compose.yml to your app folder `/home/core/fabmanager`. Then copy docker-compose.yml to your app folder `/home/core/fabmanager`.
<a id="deployment"></a>
## Deployment ## Deployment
<a id="pull-images"></a>
### pull images ### pull images
```bash ```bash
docker-compose pull docker-compose pull
``` ```
<a id="setup-database"></a>
### setup database ### setup database
```bash ```bash
@ -210,22 +197,18 @@ docker-compose run --rm fabmanager bundle exec rake db:migrate # run all the mig
docker-compose run --rm fabmanager bundle exec rake db:seed # seed the database docker-compose run --rm fabmanager bundle exec rake db:seed # seed the database
``` ```
<a id="build-assets"></a>
### build assets ### build assets
`docker-compose run --rm fabmanager bundle exec rake assets:precompile` `docker-compose run --rm fabmanager bundle exec rake assets:precompile`
<a id="prepare-elastic"></a>
### prepare Elasticsearch (search engine) ### prepare Elasticsearch (search engine)
`docker-compose run --rm fabmanager bundle exec rake fablab:es_build_stats` `docker-compose run --rm fabmanager bundle exec rake fablab:es_build_stats`
<a id="start-services"></a>
#### start all services #### start all services
`docker-compose up -d` `docker-compose up -d`
<a id="generate-ssl-cert-letsencrypt"></a>
### Generate SSL certificate by Letsencrypt ### Generate SSL certificate by Letsencrypt
**Important: app must be run before starting letsencrypt** **Important: app must be run before starting letsencrypt**
@ -252,7 +235,6 @@ sudo systemctl start letsencrypt.timer
(check) sudo systemctl list-timers (check) sudo systemctl list-timers
``` ```
<a id="docker-utils"></a>
## Docker utils ## Docker utils
### Restart app ### Restart app
@ -275,12 +257,10 @@ sudo systemctl start letsencrypt.timer
`docker-compose restart` `docker-compose restart`
<a id="update-fabmanager"></a>
## Fabmanager update ## Fabmanager update
*This procedure updates fabmanager to the last version by default.* *This procedure updates fabmanager to the last version by default.*
<a id="update-steps"></a>
### Steps ### Steps
@ -323,7 +303,6 @@ They execute specific tasks so they can't be automatic and have to be run by han
You can check that all containers are running with `docker ps`. You can check that all containers are running with `docker ps`.
<a id="good-to-know"></a>
### Good to know ### Good to know
#### Is it possible to update several versions at the same time ? #### Is it possible to update several versions at the same time ?