Running with Docker » History » Version 8
Luke Murphey, 06/03/2019 09:11 PM
| 1 | 1 | Luke Murphey | h1. Running with Docker |
|---|---|---|---|
| 2 | 1 | Luke Murphey | |
| 3 | 2 | Luke Murphey | h2. Prerequisites |
| 4 | 1 | Luke Murphey | |
| 5 | 2 | Luke Murphey | You will need to have Docker installed. See https://docs.docker.com/install/. |
| 6 | 2 | Luke Murphey | |
| 7 | 2 | Luke Murphey | You will also need a copy of the works database (library.sqlite). |
| 8 | 2 | Luke Murphey | |
| 9 | 2 | Luke Murphey | h2. Getting the TextCritical Docker image running |
| 10 | 2 | Luke Murphey | |
| 11 | 2 | Luke Murphey | h3. Download TextCritical code |
| 12 | 4 | Luke Murphey | |
| 13 | 7 | Luke Murphey | Download a zip file of the project from https://github.com/LukeMurphey/textcritical_net. You can do this by the "Clone or download" button and selecting "Download ZIP". |
| 14 | 2 | Luke Murphey | |
| 15 | 2 | Luke Murphey | !download_zip.png! |
| 16 | 2 | Luke Murphey | |
| 17 | 2 | Luke Murphey | Unzip the downloaded file into a directory. |
| 18 | 2 | Luke Murphey | |
| 19 | 2 | Luke Murphey | h3. Put a copy of the database in the var directory of the source-code |
| 20 | 2 | Luke Murphey | |
| 21 | 6 | Luke Murphey | Obtain a copy of the library of works (library.sqlite) and place it in the /var directory of the source-code (i.e. textcritical_net-master/var/library.sqlite). You can use "the library of works attached":https://lukemurphey.net/attachments/download/461/library.sqlite to this wiki entry to get started quickly (although it only includes on work). |
| 22 | 2 | Luke Murphey | |
| 23 | 2 | Luke Murphey | h3. Build the docker image |
| 24 | 2 | Luke Murphey | |
| 25 | 2 | Luke Murphey | Run the following from the directory where you unzipped the source code. This needs to be the same directory with the file with the name "Dockerfile": |
| 26 | 2 | Luke Murphey | |
| 27 | 2 | Luke Murphey | <pre> |
| 28 | 2 | Luke Murphey | docker build -t textcritical . |
| 29 | 2 | Luke Murphey | </pre> |
| 30 | 2 | Luke Murphey | |
| 31 | 2 | Luke Murphey | |
| 32 | 2 | Luke Murphey | h3. Start the docker image |
| 33 | 2 | Luke Murphey | |
| 34 | 2 | Luke Murphey | Start the docker image with the following command: |
| 35 | 2 | Luke Murphey | |
| 36 | 2 | Luke Murphey | <pre> |
| 37 | 2 | Luke Murphey | docker run -p 8080:8080 textcritical |
| 38 | 2 | Luke Murphey | </pre> |
| 39 | 2 | Luke Murphey | |
| 40 | 2 | Luke Murphey | You should now be able to access TextCritical on port 8080 on your localhost (http://localhost:8080). |
| 41 | 8 | Luke Murphey | |
| 42 | 8 | Luke Murphey | |
| 43 | 8 | Luke Murphey | h3. Set the superuser login |
| 44 | 8 | Luke Murphey | |
| 45 | 8 | Luke Murphey | Connect to the running Docker image shell. Then initialize the database: |
| 46 | 8 | Luke Murphey | |
| 47 | 8 | Luke Murphey | <pre> |
| 48 | 8 | Luke Murphey | python manage.py migrate |
| 49 | 8 | Luke Murphey | </pre> |
| 50 | 8 | Luke Murphey | |
| 51 | 8 | Luke Murphey | Next: create a super user with the following command: |
| 52 | 8 | Luke Murphey | |
| 53 | 8 | Luke Murphey | <pre> |
| 54 | 8 | Luke Murphey | python manage.py createsuperuser |
| 55 | 8 | Luke Murphey | </pre> |