-
Notifications
You must be signed in to change notification settings - Fork 6
2. Setup
Start by cloning git clone https://github.com/denesdata/roeim.git
(old repo name .../covid19-romania.git
) this repository into a folder of your choice.
Then, before you can docker-compose up
, you will need to jump through a few hoops.
- BTW, first thing is to install docker-compose, if you haven't already:
apt install docker-compose
- Next, go into
sudo
, asdocker
is a bit picky with non-superusers:sudo bash
Then, after pulling everything, you should end up with a docker-compose.yml
and a traefik.toml
file, as well as a jupyter
folder, with a Dockerfile
in it.
The next thing you want to do is to set up your passwords.
- First, go into the jupyter/Dockerfile and change
YOUR_PASSWORD_HERE
with your chosen password to access Jupyter. Next, in the terminal type:export INFLUXDB_ADMIN_PASSWORD=YOUR_PASSWORD_HERE
and changeYOUR_PASSWORD_HERE
with your chosen password for the InfluxDB admin user.Next, in the terminal type:export INFLUXDB_USER_PASSWORD=YOUR_PASSWORD_HERE
and changeYOUR_PASSWORD_HERE
with your chosen password for InfluxDB editor user.- Next, in the terminal type:
export DOCKER_INFLUXDB_INIT_PASSWORD=YOUR_PASSWORD_HERE
and changeYOUR_PASSWORD_HERE
with your chosen password for InfluxDB editor user. You will need to be on the same user account for this step to work, as the one from where you intend todocker-compose up
at the end. I.e., if you aresudo now
you will have to use theroot
account todocker-compose up
. - Finally, we need to set up the Traefik monitor. You may want to read this tutorial before you start.
- Weβll use the
htpasswd
utility to create this encrypted password. - First, install the utility, which is included in the
apache2-utils
package:sudo apt-get install apache2-utils
- Then generate the password with
htpasswd
command:htpasswd -nb admin YOUR_PASSWORD_HERE
. SubstituteYOUR_PASSWORD_HERE
with the password youβd like to use for the Traefik admin user. - The output from the program will look like this:
admin:$apr1$uca84Hq$mbjdMZBAG.KWn7vfN/SNK/
. We will use this output in the Traefik configuration file to set up HTTP Basic Authentication for the Traefik health check and monitoring dashboard. Copy the entire output line so you can paste it later.
Now we're ready to configure Traefik to route our services correctly. Create a dummy certificate file and set its correct permissions.
touch acme.json
chmod 600 acme.json
- Next up, edit the
traefik.toml
file and change every path containingmyserv.er
to your server's domain. - Then, in the
users
section replace<YOUR_HASH_HERE>
with your Traefik password hash generated withhtpasswd
at the previous step.
Finally, you will need to configure the correct addresses for your services for Traefik in the docker-compose.yml
file.
- Edit the
docker-compose.yml
file and change every path containingmyserv.er
to your server's domain. - Do not change any ports, unless you also do it in
traefik.toml
. - Set up any custom environment variables, such as Grafana plugins or InfluxDB databases.
π If you did everything correctly, then following command should lift you off:
docker-compose up
- If you get a network not found error, try
docker network create web
- You might want to use
docker-compose up -d --build
instead to run in detached mode (in the background), and force an image build (although it will build on first run anyway). - On migration and upgrades you might want to start with a clean Docker environment. For this stop and remove all containers (
docker-compose down
in the root directory of your project) and remove all unused images (docker image prune -a
- be careful to understand what this means.) - After that, run
docker-compose up -d
again and you should see all your data nicely preserved, but not the styling. For this run the styling script again covered at the end of this section.
π Continue by starting the 3. Run.
π·π΄πΉππ COVID-19 - Romanian Economic Impact Monitor https://econ.ubbcluj.ro/coronavirus