diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11d5bbe --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +* +!/**/ +!*.* +!Dockerfile diff --git a/Phase-07/README.md b/Phase-07/README.md new file mode 100644 index 0000000..0455e3c --- /dev/null +++ b/Phase-07/README.md @@ -0,0 +1,25 @@ +# How to run + +# Login to ghcr.io + +```bash +$ docker login ghcr.io +``` + +## Pull + +```bash +$ docker compose pull +``` + +## Run + +```bash +$ docker compose up +``` + +## Test the API + +```bash +$ curl -X GET http://localhost:9123/trace/www.google.com?maxHops=15 +``` \ No newline at end of file diff --git a/Phase-07/docker-compose.yaml b/Phase-07/docker-compose.yaml new file mode 100644 index 0000000..217c4c6 --- /dev/null +++ b/Phase-07/docker-compose.yaml @@ -0,0 +1,40 @@ +services: + backend: + restart: always + image: ghcr.io/star-academy/summer1403-devops-team12/traceroute-api + + environment: + - REDIS_CONN_STR=redis://database:6379 + + ports: + - "8080:8080" + + depends_on: + database: + condition: service_healthy + + database: + restart: always + image: redis:7.4-alpine + + healthcheck: + test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] + interval: 1s + timeout: 3s + retries: 5 + + volumes: + - redis-data:/data + + command: + [ + "redis-server", + "--save", + "60", + "1", + "--loglevel", + "warning" + ] + +volumes: + redis-data: {}