overall look of the project components (* beside these main components locust and swagger have also been added *):
further detials can be found in this document : web_hw1_1402 _final.pdf
create the network and build the images required
docker network create --driver bridge project-network
docker build -t gateway-server ./gateway
docker build -t auth-server ./auth/
run the folowing command for running redis and the redis monitor ... the redis monitor will be on port 8001 of local host the redis password is "SuperSecretSecureStrongPass" ```bash docker run -d --rm --name redis -v `pwd`/config:/etc/redis/ redis:6.0-alpine redis-server /etc/redis/redis.conf docker network connect project-network redis --alias redis docker run -d --rm --name gateway_redis -v `pwd`/config:/etc/redis/ redis:6.0-alpine redis-server /etc/redis/redis.conf docker network connect project-network gateway_redis --alias gateway_redis docker run -p 8001:8001 -d --rm --network=project-network redislabs/redisinsight:latest ``` u can also use the redis CLI to view the expiration time... run this command on a new terminal first: ```bash docker exec -it redis redis-cli -a "SuperSecretSecureStrongPass" ``` and then u can use ```TTL ``` inside the cli to see the expiration time
for the auth server run the following commands: ```bash docker run --network=project-network --network-alias=auth-server -p 9000:9000 -d --name auth-server auth-server ```
to start the gateway server run the following docker commands:
docker run -d --name gateway-server gateway-server
docker network connect project-network gateway-server --alias gateway-server
start the Nginx container and connect it to the network created
docker run --name nginx --network=project-network -p 80:80 -v `pwd`/config/default.conf:/etc/nginx/conf.d/default.conf -d nginx
you can use the following command to run locust locally to test gateway:
locust -f ./locust/locustfile.py
you can access here to see the swagger UI :
http://localhost/docs/index.html