2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-24 16:21:53 +00:00
troggle/docker
2020-05-24 20:56:27 +01:00
..
compose added Rad's playground 2019-02-25 22:24:33 +00:00
backports.list Up to 1.6.11 on stretch. New manage.py. Some tidying 2018-04-15 12:00:59 +01:00
docker-cmd add all the docker commands to bulid and run troggle in a container (more of a guide than something to run) 2018-04-11 22:32:47 +01:00
docker-compose.yml Add docker readme, settings and update compose file 2019-02-26 19:19:01 +00:00
Dockerfile Prevent troggle adding the menu if there is one in the file 2019-02-23 15:30:58 +00:00
Dockerfile-django-1.4.22-wheezy Add missing expose container port and commneted command to auto start the dev server 2018-04-11 22:18:15 +01:00
Dockerfile-django-1.5.12-jessie Up to 1.6.11 on stretch. New manage.py. Some tidying 2018-04-15 12:00:59 +01:00
mysql.env added Rad's playground 2019-02-25 22:24:33 +00:00
README.md Add docker readme, settings and update compose file 2019-02-26 19:19:01 +00:00
requirements.txt Convert codebase for python3 usage 2020-05-24 20:56:27 +01:00
requirements.txt.dj-1.4.22 Update requirements for 1.5.12 and preserve the 1.4.22 requiremnets 2018-04-11 22:13:31 +01:00
requirements.txt.dj-1.5.12 Up to 1.6.11 on stretch. New manage.py. Some tidying 2018-04-15 12:00:59 +01:00
requirements.txt.dj-1.6.11 1.7 requiremnets 2018-04-15 16:45:07 +01:00
requirements.txt.dj-1.7.11 Changes needed to stop the survex parser having to go through the data twice 2020-02-21 15:57:07 +00:00
requirements.txt.dj-1.8.19 Make the suryeys importer not explode 2019-02-24 14:29:14 +00:00

Running troggle on Docker

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