Skip to content

Commit 9fc8f07

Browse files
committed
Merge branch 'master' of github.com:hioa-cs/data2410_fullstack_example
2 parents 6e07e5a + 5ffd448 commit 9fc8f07

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
## Running each container with docker
44
This example uses the `skynet` network, created with `$ docker network create skynet`. If you want to use your own network, replace `skynet` with the name of your own network.
55

6-
6+
### Starting the database
7+
The database uses the official MySQL docker image directly, with the contents of the `sql` directory mounted inside (e.g. the `sql` directory will be shared with the container)
78
Standing in the source repo, start the database like this:
89
```
910
$ docker run -it --rm -d --name mysql1 --network skynet -e MYSQL_ROOT_PASSWORD=my-secret-pw -v $(pwd)/sql:/docker-entrypoint-initdb.d mysql
1011
```
11-
Notice the `-d` - this will make the container run in the background. If you have docker for mac or docker for windows installed, you should be able to see a container named `mysql1` running.
12+
Notice the `-d` - this will make the container run in the background. If you have docker for mac or docker for windows installed you should be able to see a container named `mysql1` running.
1213

13-
The backend, which hosts both the API and the frontend can now be started like this:
14+
### Build and run the backend
15+
The backend, which hosts both the API and the frontend, has a couple of python dependencies which is nice to build into the container. Build with:
16+
```
17+
$ docker build -t python_backend ./python_backend/
18+
```
19+
This will result in an image named `python_backend`. You should be able to see that with `$ docker images` or by clikcing the "Images" label in docker for desktop.
20+
The backend can now be started like this:
1421
```
1522
$ docker run -it --rm --name pyback --network skynet -p 5000:5000 -v $(pwd)/python_backend/server.py:/var/fullstack/server.py -v $(pwd)/frontend/:/var/fullstack/frontend/ -t python_backend python /var/fullstack/server.py
1623
```
1724

1825
## Running with docker compose
19-
TODO
26+
TODO

0 commit comments

Comments
 (0)