From 3b3f5edc1b125a6ddaae194bb6db6a83f8697de8 Mon Sep 17 00:00:00 2001
From: Jiakai Li
Date: Tue, 10 Sep 2024 08:27:38 +1200
Subject: [PATCH] add test service to docker-compose
---
docker-compose.yml | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index eb5e0c3..e874b27 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,13 +11,32 @@ services:
ports:
- "80:8000"
environment:
- - REDIS_URL=redis://redis:6379
+ REDIS_URL: "redis://redis:6379"
networks:
- backend-network
depends_on:
- redis
command: "gunicorn page_tracker.app:app --bind 0.0.0.0:8000"
+ test:
+ profiles:
+ - testing
+ build:
+ context: ./web
+ dockerfile: Dockerfile.dev
+ environment:
+ REDIS_URL: "redis://redis:6379"
+ FLASK_URL: "http://web:8000"
+ networks:
+ - backend-network
+ depends_on:
+ - redis
+ - web
+ command: >
+ sh -c 'python -m pytest test/e2e/ -vv
+ --redis-url $$REDIS_URL
+ --flask-url $$FLASK_URL'
+
networks:
backend-network: