diff --git a/Makefile b/Makefile
index 1828e92..1fc53c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,35 @@
.PHONY: test
test:
+ . .venv/bin/activate
pytest -v ./athlete/tests
pytest -v ./medaille/tests
pytest -v ./discipline/tests
+clear:
+ rm -rf ./data
+
+compose:
+ docker compose up
+
+setup:
+ python3 -m venv .venv
+ . .venv/bin/activate
+ pip install -r requirements.txt
+ cp -r ./sample/ ./data/
+
clear_before_rendreTP:
- rm -rf ./data ./__pycache__ ./athlete/__pycache__ ./medaille/__pycache__ ./discipline/__pycache__
\ No newline at end of file
+ rm -rf ./.venv
+ rm -rf ./data
+ rm -rf __pycache__
+ rm -rf athlete/__pycache__
+ rm -rf medaille/__pycache__
+ rm -rf discipline/__pycache__
+
+doAll:
+ make clear_before_rendreTP
+ make setup
+ make test
+ make compose
+ docker compose down
+ make clear_before_rendreTP
\ No newline at end of file
diff --git a/data/athletes.json b/data/athletes.json
index bd72eda..9896058 100644
--- a/data/athletes.json
+++ b/data/athletes.json
@@ -1,8 +1,8 @@
[
{
"id": 1,
- "prenom": "Riner",
- "nom": "Teddy",
+ "prenom": "Teddy",
+ "nom": "Riner",
"pays": "France",
"sexe": "H",
"image": "https://upload.wikimedia.org/wikipedia/commons/4/4e/Teddy_Riner_2012.jpg",
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 068f708..0c805bd 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -1,7 +1,6 @@
version: "3.3"
services:
-
traefik:
image: "traefik:v2.11"
container_name: "proxy"
@@ -43,4 +42,24 @@ services:
- "traefik.http.routers.disciplines.middlewares=disciplines-stripprefix"
- "traefik.http.middlewares.disciplines-stripprefix.stripprefix.prefixes=/disciplines"
volumes:
- - "athlete:/app/data"
\ No newline at end of file
+ - "discipline:/app/data"
+
+ medaille:
+ image: "jo2024/medaille"
+ container_name: "medaille-service"
+ build:
+ context: .
+ dockerfile: ./medaille/Dockerfile
+ labels:
+ - "traefik.enable=true"
+ - "traefik.http.routers.medaille-service.entrypoints=web"
+ - "traefik.http.routers.medaille.rule=PathPrefix(`/medailles{regex:$$|/.*}`)"
+ - "traefik.http.routers.medaille.middlewares=medaille-stripprefix"
+ - "traefik.http.middlewares.medaille-stripprefix.stripprefix.prefixes=/medailles"
+ volumes:
+ - "medaille:/app/data"
+
+volumes:
+ athlete:
+ discipline:
+ medaille:
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index 70fbd72..272b48d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@ flask==3.0.2
pydantic==2.6.4
pytest
flask_swagger_ui
-gunicorn
\ No newline at end of file
+gunicorn