diff --git a/README.md b/README.md index 3cfd91c..bc28079 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ If there are other AKS features you'd like to see here that help with developer ## Prerequisites It is assumed you have basic knowledge of Containers, Kubernetes and Azure. You would also require Contributor and User Access Admin access to an Azure subscription and an AAD tenant where you have User Admin access. On your computer you will need to have the following installed * git, -* [Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/install), -* [jq](https://stedolan.github.io/jq/download/), -* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/), +* [Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/install) +* [jq](https://stedolan.github.io/jq/download/) +* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/) * [sed](https://gnuwin32.sourceforge.net/packages/sed.htm) (optional) * [node and npm](https://nodejs.org/en/download/) for the Bridge to Kubernetes step * Azure CLI @@ -46,16 +46,24 @@ You will also require visual studio code with the following extensions installed You can install these by searching for them in the Extensions tab. ## Test the app on your computer (optional) -If you have docker desktop install on your computer and you have some experience with docker-compose you can run the application on your local computer. +If you have docker desktop install and started on your computer, and you have some experience with docker-compose you can run the application on your local computer. +Introduce a bug in the code so that we can correct it later +> :warning: If you are using a mac you will need to change the command to `sed -i "s/Sign In/Signing In/" smartbrain/smartbrain/smartbrainclient/src/components/Signin/Signin.js`. + +> :bulb: If these sed commands don't work for any reason or if you don't have sed installed, you will need to update these files manually by replacing the placeholders in the files mentioned below. +```bash +sed -i "s/Sign In/Signing In/" smartbrain/smartbrain/smartbrainclient/src/components/Signin/Signin.js +``` Run the application using docker-compose. ```bash -cd fib-calculator +cd smartbrain/smartbrain docker-compose up ``` You can access the website at port 3050 on your local computer using NGINX as an ingress controller. Check out the docker-compose.yaml file for more details. ![App running on local computer](./media/running-local.png) -You can test the app by entering a number under 40, clicking submit and refreshing the page. -> :bulb: You might find that there is a bug in the fibonacci number calculation. This bug will be fixed in the **Testing & Debugging individual microservices using Bridge to Kubernetes** section of the workshop. +You can test the app by clicking on register and providing the required information. + +> :bulb: You might find that there is a bug in the spelling of Password. This bug will be fixed in the **Testing & Debugging individual microservices using Bridge to Kubernetes** section of the workshop. Here is what the architecture of the app looks like ![App architecture](./media/service-architecture.png) diff --git a/fib-calculator/docker-compose.yaml b/fib-calculator/docker-compose.yaml index e85f9d8..c92d2c5 100644 --- a/fib-calculator/docker-compose.yaml +++ b/fib-calculator/docker-compose.yaml @@ -4,6 +4,7 @@ services: image: 'postgres:latest' environment: - POSTGRES_PASSWORD=postgres_password + - POSTGRES_USER=pguser redis: image: 'redis:latest' nginx: @@ -12,16 +13,18 @@ services: - client restart: always build: - dockerfile: Dockerfile.dev + dockerfile: Dockerfile context: ./nginx ports: - '3050:80' api: depends_on: - postgres + - redis + - worker build: - dockerfile: Dockerfile.dev - context: ./server + dockerfile: Dockerfile + context: ./smartbrainapi ports: - "5000:5000" # volumes: @@ -30,7 +33,7 @@ services: environment: - REDIS_HOST=redis - REDIS_PORT=6379 - - PGUSER=postgres + - PGUSER=pguser - PGHOST=postgres - PGDATABASE=postgres - PGPASSWORD=postgres_password @@ -47,21 +50,21 @@ services: stdin_open: true container_name: client build: - context: ./client + context: ./smartbrainclient dockerfile: Dockerfile - # volumes: - # - '.:/app' - # - '/app/node_modules' + volumes: + - /app/src + - ./smartbrainclient/src:/app/src ports: - 3000:3000 environment: - CHOKIDAR_USEPOLLING=true worker: build: - dockerfile: Dockerfile.dev - context: ./worker + dockerfile: Dockerfile + context: ./smartbrainml ports: - - 5001:5001 + - 2000:2000 # volumes: # - /app/node_modules # - ./worker:/app diff --git a/media/running-local.png b/media/running-local.png index f572e58..78e09a9 100644 Binary files a/media/running-local.png and b/media/running-local.png differ diff --git a/media/service-architecture.png b/media/service-architecture.png index 36ec8ee..9b61794 100644 Binary files a/media/service-architecture.png and b/media/service-architecture.png differ