Skip to content

Commit 7d8ae72

Browse files
Changed order of the readme
1 parent 2e386cb commit 7d8ae72

File tree

1 file changed

+65
-63
lines changed

1 file changed

+65
-63
lines changed

README.md

Lines changed: 65 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,5 @@
11
# Run
2-
## Docker
3-
This project supports docker runtime environment, for which you will need to download docker from here: https://www.docker.com/products/docker-desktop/.
4-
5-
For this project, be aware that express listens on a specfic port (can be found in /API/Endpoints), which must be the same port that is used in the docker file.
6-
7-
Open a terminal and navigate to the root of the project.
8-
9-
### Docker network
10-
11-
If you run other services like a repository or service registry through docker locally, you will also need to setup a network. This creates a connection between local docker containers which is essential for establishing a connection.
12-
13-
If you want to run the project(s) with docker compose, the network needs to be created before running the compose file.
14-
15-
To create a docker network run below the commands below in a terminal:
16-
17-
```
18-
docker network create -d bridge data
19-
```
20-
### Docker Compose
21-
It is recommended to use this approach to run the application. To run this project using docker-compose you need to follow the steps below:
222

23-
Build the docker image:
24-
```
25-
docker-compose build
26-
```
27-
Run the docker image:
28-
```
29-
docker-compose up
30-
```
31-
Stop the docker image:
32-
```
33-
docker-compose down
34-
```
35-
36-
### Dockerfile
37-
Alternatively you can build the image directly from the Dockerfile by running the following commands from the root of the project:
38-
39-
```
40-
docker build -t dockerminer .
41-
docker run -d -p 5000:5000 --name Miner dockerminer:latest
42-
```
43-
44-
When running in docker, localhost and 127.0.0.1 will resolve to the container. If you want to access the outside host (e.g. your machine), you can add an entry to the container's /etc/hosts file. You can read more details on this here: https://www.howtogeek.com/devops/how-to-connect-to-localhost-within-a-docker-container/
45-
This will make localhost available as your destination when requesting from your host-unit e.g. from postman or the browser, not between containers.
46-
47-
To access the outside host, write the following docker run command instead of the one written above:
48-
```
49-
docker run -d -p 5000:5000 --add-host host.docker.internal:host-gateway --name Miner dockerminer:latest
50-
```
51-
52-
Here the value "host.docker.internal" maps to the container's host gateway, which matches the real localhost value. This name can be replaced with your own string.
53-
54-
To establish connections between containers, add a reference to the network by adding the below to your docker run:
55-
56-
```
57-
--network=data
58-
```
59-
60-
The full run command we recommend for local development:
61-
62-
```
63-
docker run -d -p 5000:5000 --add-host localhost:host-gateway --network=data --name Miner dockerminer:latest
64-
```
653
## Standard
664
If you wish to use the Miner Wrapper directly on your machine (without Docker), you must at least install
675
- Node 16 or newer: https://nodejs.org/en/download
@@ -232,4 +170,68 @@ Miner/Miners/yourAlgorithmExeFolder
232170
```
233171
Delete the "build" and "dist" folders, and delete the ".spec" file that were created in the folder for your python algorithm, so the only new file is the new .exe file that you moved out.
234172

235-
Add a reference to this new .exe in "config.json" along with your other miners. The config object should largely be able to be copied from the original, however, it should have a new ID and the "MinerPath" and "MinerFile" keys should reference the new folder and .exe file name.
173+
Add a reference to this new .exe in "config.json" along with your other miners. The config object should largely be able to be copied from the original, however, it should have a new ID and the "MinerPath" and "MinerFile" keys should reference the new folder and .exe file name.
174+
175+
## Docker
176+
This project supports docker runtime environment, for which you will need to download docker from here: https://www.docker.com/products/docker-desktop/.
177+
178+
For this project, be aware that express listens on a specfic port (can be found in /API/Endpoints), which must be the same port that is used in the docker file.
179+
180+
Open a terminal and navigate to the root of the project.
181+
182+
### Docker network
183+
184+
If you run other services like a repository or service registry through docker locally, you will also need to setup a network. This creates a connection between local docker containers which is essential for establishing a connection.
185+
186+
If you want to run the project(s) with docker compose, the network needs to be created before running the compose file.
187+
188+
To create a docker network run below the commands below in a terminal:
189+
190+
```
191+
docker network create -d bridge data
192+
```
193+
### Docker Compose
194+
It is recommended to use this approach to run the application. To run this project using docker-compose you need to follow the steps below:
195+
196+
Build the docker image:
197+
```
198+
docker-compose build
199+
```
200+
Run the docker image:
201+
```
202+
docker-compose up
203+
```
204+
Stop the docker image:
205+
```
206+
docker-compose down
207+
```
208+
209+
### Dockerfile
210+
Alternatively you can build the image directly from the Dockerfile by running the following commands from the root of the project:
211+
212+
```
213+
docker build -t dockerminer .
214+
docker run -d -p 5000:5000 --name Miner dockerminer:latest
215+
```
216+
217+
When running in docker, localhost and 127.0.0.1 will resolve to the container. If you want to access the outside host (e.g. your machine), you can add an entry to the container's /etc/hosts file. You can read more details on this here: https://www.howtogeek.com/devops/how-to-connect-to-localhost-within-a-docker-container/
218+
This will make localhost available as your destination when requesting from your host-unit e.g. from postman or the browser, not between containers.
219+
220+
To access the outside host, write the following docker run command instead of the one written above:
221+
```
222+
docker run -d -p 5000:5000 --add-host host.docker.internal:host-gateway --name Miner dockerminer:latest
223+
```
224+
225+
Here the value "host.docker.internal" maps to the container's host gateway, which matches the real localhost value. This name can be replaced with your own string.
226+
227+
To establish connections between containers, add a reference to the network by adding the below to your docker run:
228+
229+
```
230+
--network=data
231+
```
232+
233+
The full run command we recommend for local development:
234+
235+
```
236+
docker run -d -p 5000:5000 --add-host localhost:host-gateway --network=data --name Miner dockerminer:latest
237+
```

0 commit comments

Comments
 (0)