This commit is contained in:
Mael G. 2024-03-27 15:31:11 +01:00
parent c84d872927
commit 36bd9d3e21
4 changed files with 51 additions and 6 deletions

View file

@ -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__
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

View file

@ -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",

View file

@ -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"
- "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:

View file

@ -2,4 +2,4 @@ flask==3.0.2
pydantic==2.6.4
pytest
flask_swagger_ui
gunicorn
gunicorn