2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00
troggle/_deploy/docker
2021-05-13 00:00:39 +03:00
..
compose rearranged config files 2021-05-03 22:47:57 +01:00
backports.list rearranged config files 2021-05-03 22:47:57 +01:00
docker-cmd rearranged config files 2021-05-03 22:47:57 +01:00
docker-compose.yml rearranged config files 2021-05-03 22:47:57 +01:00
Dockerfile rearranged config files 2021-05-03 22:47:57 +01:00
Dockerfile-django-1.4.22-wheezy rearranged config files 2021-05-03 22:47:57 +01:00
Dockerfile-django-1.5.12-jessie rearranged config files 2021-05-03 22:47:57 +01:00
localsettingsdocker.py improving README for a new dev install 2021-05-13 00:00:39 +03:00
mysql.env rearranged config files 2021-05-03 22:47:57 +01:00
README.md rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt.dj-1.4.22 rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt.dj-1.5.12 rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt.dj-1.6.11 rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt.dj-1.7.11 rearranged config files 2021-05-03 22:47:57 +01:00
requirements.txt.dj-1.8.19 rearranged config files 2021-05-03 22:47:57 +01:00

Running troggle on Docker

These notes written by Sam Wenham in Feb., 2019. These all pre-date the move to python3, later versions of Django (1.11.+) and debian.

Install

First you need to install

If you don't want to type sudo for every docker command (you don't) you need to add your user to the docker group.

To do this

  • Create the docker group.

    $ sudo groupadd docker
    
  • Add your user to the docker group.

    $ sudo usermod -aG docker $USER
    

Setup

Checkout all 4 of the expo repos into one folder (see here for repo cloning instructions) eg.

$ ~/expo/loser
        /troggle
        /expoweb
        /tunnel

In the troggle dir copy localsettingsdocker.py to localsettings.py

In the folder you checked out all the repos into (expo in this example) create a folder called expofiles and in that a folder called surveyscans eg

cd ~/expo
mkdir -p expofiles/surveyscans

Starting the containers

To start the containers run

$ docker-compose up

You will now have a working troggle but with no data. To import the data you need to access the container run

$ docker exec -it docker_troggle_1 /bin/bash

This will give you a shell inside the troggle container

(You may get a warning like bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8) this can be ignored)

To import the data into troggle now run

$ python databaseReset.py reset

and wait .... this takes a while. The MySQL database is stored in a docker volume so once run through once the database will remain full of expo data even if you restart the containers.

Using your new dev setup

Even whilst the import is running you can browse to [http://localhost:8000]

Any chnages made to files in your checkouts will be automatically loaded in the container and served. Somtimes changes to the python files will require the system to reload so refresh a couple of times before declaring you have broken something.

If you edit files from within the container they will have their ownership changed to root and may become un editable to your user (you will have to become root to fix this) so don't do this!

Stopping the containers

To stop the running containers press Ctrl-c

Killing it all

If you get it in some state you want to start again run

$ docker-compose down

to destroy the containers and

$ docker volume ls
$ docker volume rm docker_expo-mysqldb

to remove the database volume