done
This commit is contained in:
parent
c84d872927
commit
36bd9d3e21
4 changed files with 51 additions and 6 deletions
28
Makefile
28
Makefile
|
@ -1,9 +1,35 @@
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
. .venv/bin/activate
|
||||||
pytest -v ./athlete/tests
|
pytest -v ./athlete/tests
|
||||||
pytest -v ./medaille/tests
|
pytest -v ./medaille/tests
|
||||||
pytest -v ./discipline/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:
|
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
|
|
@ -1,8 +1,8 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"prenom": "Riner",
|
"prenom": "Teddy",
|
||||||
"nom": "Teddy",
|
"nom": "Riner",
|
||||||
"pays": "France",
|
"pays": "France",
|
||||||
"sexe": "H",
|
"sexe": "H",
|
||||||
"image": "https://upload.wikimedia.org/wikipedia/commons/4/4e/Teddy_Riner_2012.jpg",
|
"image": "https://upload.wikimedia.org/wikipedia/commons/4/4e/Teddy_Riner_2012.jpg",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
version: "3.3"
|
version: "3.3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
traefik:
|
traefik:
|
||||||
image: "traefik:v2.11"
|
image: "traefik:v2.11"
|
||||||
container_name: "proxy"
|
container_name: "proxy"
|
||||||
|
@ -43,4 +42,24 @@ services:
|
||||||
- "traefik.http.routers.disciplines.middlewares=disciplines-stripprefix"
|
- "traefik.http.routers.disciplines.middlewares=disciplines-stripprefix"
|
||||||
- "traefik.http.middlewares.disciplines-stripprefix.stripprefix.prefixes=/disciplines"
|
- "traefik.http.middlewares.disciplines-stripprefix.stripprefix.prefixes=/disciplines"
|
||||||
volumes:
|
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:
|
Loading…
Reference in a new issue