From 94d2e97216b6ea3ef8c3c311e8753a9c9bc79462 Mon Sep 17 00:00:00 2001 From: Alfred Bratterud Date: Sat, 1 May 2021 12:12:26 +0200 Subject: [PATCH 1/2] Update README.md Add missing info on building the backend --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 90a2441..83e8d9a 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,24 @@ ## Running each container with docker 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. - +### Starting the database +The database usess 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) Standing in the source repo, start the database like this: ``` $ docker run -it --rm -d --name mysql1 --network skynet -e MYSQL_ROOT_PASSWORD=my-secret-pw -v $(pwd)/sql:/docker-entrypoint-initdb.d mysql ``` 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. -The backend, which hosts both the API and the frontend can now be started like this: +### Build and run the backend +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: +``` + $ docker build -t python_backend ./python_backend/ +``` +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. +The backend can now be started like this: ``` $ 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 ``` ## Running with docker compose -TODO \ No newline at end of file +TODO From 5ffd448eb9ae480afd0ca41a9a9ecfc2d8168f5f Mon Sep 17 00:00:00 2001 From: Alfred Bratterud Date: Sat, 1 May 2021 21:13:03 +0200 Subject: [PATCH 2/2] Update README.md typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 83e8d9a..7de6987 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ 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. ### Starting the database -The database usess 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) +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) Standing in the source repo, start the database like this: ``` $ docker run -it --rm -d --name mysql1 --network skynet -e MYSQL_ROOT_PASSWORD=my-secret-pw -v $(pwd)/sql:/docker-entrypoint-initdb.d mysql ``` -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. +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. ### Build and run the backend 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: