2020-03-18 19:11:10 +00:00
|
|
|
# Install (Ubuntu LTS)
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-16 21:58:44 +00:00
|
|
|
ENSL Website is fairly easy to run.
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-21 20:32:48 +00:00
|
|
|
## 1. Install requirements: docker, docker-compose and git
|
2014-03-23 04:13:19 +00:00
|
|
|
|
2020-03-16 21:58:44 +00:00
|
|
|
https://docs.docker.com/install/
|
|
|
|
https://docs.docker.com/compose/install/
|
2014-03-23 04:13:19 +00:00
|
|
|
|
2020-03-16 21:58:44 +00:00
|
|
|
Install docker + docker-compose:
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-03-16 21:58:44 +00:00
|
|
|
wget -O - 'https://get.docker.com/'|bash
|
|
|
|
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
2014-03-23 00:56:13 +00:00
|
|
|
|
2020-03-21 20:32:48 +00:00
|
|
|
Install git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
|
2020-03-18 19:11:10 +00:00
|
|
|
|
2020-03-22 12:49:27 +00:00
|
|
|
sudo apt-get install git
|
2014-03-25 11:15:49 +00:00
|
|
|
|
2020-03-22 12:49:27 +00:00
|
|
|
## 2. Download ENSL website and install it
|
2014-03-23 00:56:13 +00:00
|
|
|
|
2020-03-16 21:58:44 +00:00
|
|
|
git clone git@github.com:ENSL/ensl.org.git
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2020-04-05 03:36:21 +00:00
|
|
|
## 3. Second build the ENSL docker containers.
|
|
|
|
|
|
|
|
cd ensl.org
|
|
|
|
docker-compose build
|
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
## 4. Put any database dumps to `db/initdb.d`. (optional)
|
2014-03-23 01:22:47 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
mysqldump --opt -h DATABASE_IP -u USERNAME DATABASE_NAME > 00_ensl.org.`date +%F`.sql
|
|
|
|
mv 00_ensl.org.`date +%F`.sql db/initdb.d/00_ensl.org.`date +%F`.sql
|
2014-03-25 11:15:49 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
You need to manually copy it to staging database on same db server for now.
|
2014-03-31 21:33:16 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
## 5. First select your environment (eg. production). Then use a script to load the env vars to your shell env:
|
2020-03-18 19:11:10 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
source script/env.sh .env .env.production
|
2020-03-31 02:31:42 +00:00
|
|
|
|
2020-04-05 03:36:21 +00:00
|
|
|
## 6. Then start the whole thing
|
2020-03-22 12:49:27 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
docker-compose up production
|
2020-04-05 03:36:21 +00:00
|
|
|
docker-compose down
|
2020-03-22 12:49:27 +00:00
|
|
|
|
2020-04-05 03:36:21 +00:00
|
|
|
## 7. Install reverse proxy (production only)
|
2020-03-22 12:49:27 +00:00
|
|
|
|
2020-04-08 19:25:24 +00:00
|
|
|
a) The docker-compose contains basic nginx setup. It's in docker-compose. Use that.
|
2020-03-18 19:11:10 +00:00
|
|
|
|
2020-04-05 03:36:21 +00:00
|
|
|
b) If you have your own NGINX setup, just use the sample site file from the ext/nginx.conf.d
|
2020-03-18 19:11:10 +00:00
|
|
|
|
|
|
|
https://www.nginx.com/resources/wiki/start/
|
|
|
|
|
|
|
|
sudo apt-get install nginx
|