Merge pull request 'simplified docker steps' (#3) from development_docker_simple into main
Reviewed-on: tfgrid/www_threefold4#3
This commit is contained in:
		@@ -16,36 +16,21 @@ We provide the steps to prepare a Docker Ubuntu container to work with Hero and
 | 
			
		||||
## Prerequisites
 | 
			
		||||
 | 
			
		||||
- Docker
 | 
			
		||||
- Make sure that you have set your SSH Public Key on both GitHub and the TFGrid Gitea (https://git.ourworld.tf)
 | 
			
		||||
 | 
			
		||||
## Deploy Webserver
 | 
			
		||||
 | 
			
		||||
- Run the Ubuntu container with host networking and a specific name
 | 
			
		||||
```
 | 
			
		||||
sudo docker run -it --net=host --name=hero-container -v ~/dvol:/root/code ubuntu:latest /bin/bash
 | 
			
		||||
```
 | 
			
		||||
- Create Directory .ssh in container
 | 
			
		||||
```
 | 
			
		||||
mkdir -p ~/.ssh
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
- Copy SSH keys to container from local machine (use the proper path and key type)
 | 
			
		||||
```
 | 
			
		||||
sudo docker cp ~/.ssh/id_ed25519 hero-container:/root/.ssh/id_ed25519
 | 
			
		||||
sudo docker cp ~/.ssh/id_ed25519.pub hero-container:/root/.ssh/id_ed25519.pub
 | 
			
		||||
sudo docker run -it --net=host --name=hero-container -v ~/code:/root/code ubuntu:latest /bin/bash
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
- Execute all commands directly in the container
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
# Install prerequisites
 | 
			
		||||
 | 
			
		||||
apt update && apt install -y git curl nano openssh-client libsqlite3-dev python3-venv
 | 
			
		||||
 | 
			
		||||
# Set up SSH agent and add the key
 | 
			
		||||
 | 
			
		||||
eval $(ssh-agent)
 | 
			
		||||
ssh-add ~/.ssh/id_ed25519
 | 
			
		||||
export DEBIAN_FRONTEND=noninteractive
 | 
			
		||||
apt-get update -y
 | 
			
		||||
apt-get install -y git curl nano openssh-client libsqlite3-dev python3-venv
 | 
			
		||||
 | 
			
		||||
# Clone the repository and set up the environment
 | 
			
		||||
 | 
			
		||||
@@ -77,5 +62,5 @@ When you're done, you can clean up your environment.
 | 
			
		||||
```
 | 
			
		||||
sudo docker stop hero-container
 | 
			
		||||
sudo docker rm hero-container
 | 
			
		||||
sudo find ~/dvol -mindepth 1 -delete
 | 
			
		||||
sudo find ~/code -mindepth 1 -delete
 | 
			
		||||
```
 | 
			
		||||
		Reference in New Issue
	
	Block a user