Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase07 #11

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!/**/
!*.*
!Dockerfile
25 changes: 25 additions & 0 deletions Phase-07/README.md
Original file line number Diff line number Diff line change
@@ -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
```
40 changes: 40 additions & 0 deletions Phase-07/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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: {}