User Tools

Site Tools


medal-data-setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
medal-data-setup [2021/12/17 10:46] arnaud_polettomedal-data-setup [2022/01/10 14:55] (current) – removed arnaud_poletto
Line 1: Line 1:
-====== medAL-data Setup ====== 
  
-==== Purpose and Scope ==== 
- 
-This page lists instructions to setup a medAL-//data// server instance and is intended to be read carefully by the entities involved in setting up the various components of the medAL suite.  
- 
- 
- 
- 
-==== Material ==== 
- 
-You will need the following material: 
- 
-  * A Linux server with the following minimal requirements: 
-    * 8GB RAM 
-    * 300GB disk capacity 
-    * Operating System: Ubuntu >= 18.04 
-  * A controlling workstation (Linux / MacOS / Windows) with the following installed: 
-    * git version control software (see https://git-scm.com/) 
-    * bash terminal (for windows see : https://gitforwindows.org/) 
-  * A domain Name (In the installation we will use the name //example.com//) pointing to the server's IP address. 
- 
- 
- 
- 
-===== Manual Installation ===== 
- 
-==== Environment Setup ==== 
- 
-Firstly, open up two terminals **[t_local]** and **[t_remote]** on the controlling workstation, on **[t_remote]** connect to the root account of the remote server using ssh: 
-<code>ssh root@example.com</code> 
- 
- 
- 
- 
-=== Dokku Installation on Remote Server === 
- 
-To setup the dokku installation, follow these steps: 
- 
-  - **[t_remote]** Install dokku with the following commands: \\ <code> 
-wget https://raw.githubusercontent.com/dokku/dokku/v0.24.10/bootstrap.sh 
-sudo DOKKU_TAG=v0.24.10 bash bootstrap.sh  
-</code> To get the latest verison go to https://dokku.com/docs/getting-started/installation/ 
- 
-  - **[t_local]** On the local workstation, open a browser and head to your server domain ''example.com'' where you will be able to setup the public SSH key used when deploying the source code to the server and optionnaly enable virtual hosting on the server: 
-    If you already have a ssh key configured for git on your local workstation, then copy the value of the public key and paste in the dialog on dokku's web interface. If you already have a public key then you can copy the value output from the command: \\ <code> 
-cat ~/.ssh/id_rsa.pub 
-</code>, or generate a new one using: \\ <code> 
-ssh-keygen -t rsa 
-</code> 
-    Enter your domain name ''example.com'' in the corresponding dialog box  
- 
- 
- 
- 
-==== Application Setup ==== 
- 
-=== Application Deployment === 
- 
-Now, deploy your application by following this procedure: 
- 
-  - **[t_remote]** Run the following commands to create and configure the dokku app for the medAL-//data// server: \\ <code> 
-# Create the App 
-dokku apps:create medal-data 
-# Install the postgres DB plugin 
-sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres 
-# Create Database 
-dokku postgres:create medal-data-db 
-# Link the App to the database 
-dokku postgres:link medal-data-db medal-data 
-# Set Config variables for Laravel 
-dokku config:set medal-data DB_CONNECTION=postgres 
-# Add the PHP buildpack to the apps config 
-dokku config:set medal-data BUILDPACK_URL="https://github.com/heroku/heroku-buildpack-php" 
-# Configure the storage folder of the server 
-mkdir -p /var/lib/dokku/data/storage/medal-data 
-mkdir -p /var/lib/dokku/data/storage/medal-data/framework 
-mkdir -p /var/lib/dokku/data/storage/medal-data/framework/sessions 
-mkdir -p /var/lib/dokku/data/storage/medal-data/framework/cache 
-mkdir -p /var/lib/dokku/data/storage/medal-data/framework/views 
-# give rights to herokuish 
-chown -R 32767:32767 /var/lib/dokku/data/storage/medal-data 
-dokku storage:mount medal-data /var/lib/dokku/data/storage/medal-data:/app/storage 
-# set the scale of the application 
-dokku ps:scale medal-data web=1 worker=1 
-</code> 
-  - **[t_local]** On the local workstation, clone the source code of the medal-data server from the bitbucket repository: \\ <code> 
-git clone https://informatique_unisante@bitbucket.org/wavemind_swiss/liwi-main-data.git</code>, and navigate to the project folder: \\ <code> 
-cd liwi-main-data </code> 
-  - **[t_local]** Do a copy the ''dokku.env.example'' file and name it ''dokku.env''. Fill out the values depending on your desired configuration. Then copy the file content to your clipboard.  
-  - **[t_remote]** On the remote server, paste the content at the end of the following file: ''/home/dokku/medal-data/ENV''. 
-  - **[t_local]** Link and deploy the server with the following git commands (replace //example.com// with your own domain name): \\ <code> 
-git remote add dokku dokku@example.com:medal-data 
-git push dokku master 
-</code> If the push did not work, then make sure you have correctly set up the SSH key on the dokku server using the web interface (more information on https://dokku.com/docs/deployment/user-management/). 
-  - **[t_remote]** Back on the remote server, run the following command to set the ''APP_KEY'' environment variable: \\ <code> 
-dokku config:set medal-data APP_KEY=$(dokku run medal-data php artisan --no-ansi key:generate --show) --no-restart 
-</code> 
-  - **[t_remote]** Also run the following command to make sure that Laravel's passports encryption keys are properly generated: \\ <code> 
-dokku run medal-data php artisan passport:keys 
-</code> 
-  - **[t_remote]** Finally, migrate and seed the database using: \\ <code> 
-dokku run medal-data php artisan migrate:fresh --seed --force 
-</code> 
medal-data-setup.1639734362.txt.gz · Last modified: 2021/12/17 10:46 by arnaud_poletto