🐳 chore(docker-compose.yml): refactor backend service to use YAML anchors and aliases for code reuse

🚀 feat(docker-compose.yml): add tests service to run pytest with coverage and generate reports
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-16 00:05:26 -03:00
commit e9fd9b097f

View file

@ -68,7 +68,7 @@ services:
# to disable www redirection remove the section: ${STACK_NAME?Variable not set}-www-redirect,
- traefik.http.routers.${STACK_NAME?Variable not set}-proxy-http.middlewares=${STACK_NAME?Variable not set}-www-redirect,${STACK_NAME?Variable not set}-https-redirect
backend:
backend: &backend
image: "ogabrielluiz/langflow:latest"
build:
context: ../
@ -136,7 +136,7 @@ services:
test: "exit 0"
celeryworker:
image: "ogabrielluiz/langflow:latest"
<<: *backend
env_file:
- .env
build:
@ -149,7 +149,7 @@ services:
replicas: 1
flower:
image: "ogabrielluiz/langflow:latest"
<<: *backend
env_file:
- .env
networks:
@ -227,6 +227,17 @@ services:
- traefik.http.routers.${STACK_NAME?Variable not set}-grafana-http.rule=PathPrefix(`/grafana`)
- traefik.http.services.${STACK_NAME?Variable not set}-grafana.loadbalancer.server.port=3000
tests:
<<: *backend
env_file:
- .env
build:
context: ../
dockerfile: base.Dockerfile
command: pytest -v --cov=langflow --cov-report=term-missing --cov-report=xml --cov-report=html -m async_test
healthcheck:
test: "exit 0"
volumes:
grafana_data:
app-db-data: