diff --git a/docker-compose.ci.yaml b/docker-compose.ci.yaml new file mode 100644 index 0000000..e86ee3f --- /dev/null +++ b/docker-compose.ci.yaml @@ -0,0 +1,67 @@ +version: '3.3' +services: + db: + container_name: bemore-db + image: postgres:12 + volumes: + - app-db-data:/var/lib/postgresql/data/pgdata + env_file: + - .env + environment: + - PGDATA=/var/lib/postgresql/data/pgdata + networks: + - default + + queue: + container_name: bemore-queue + image: rabbitmq:3 + # Using the below image instead is required to enable the "Broker" tab in the flower UI: + # image: rabbitmq:3-management + # + # You also have to change the flower command + + + backend: + tty: true + container_name: bemore-backend + image: ${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest} + depends_on: + - db + env_file: + - .env + environment: + # Allow explicit env var override for tests + - SMTP_HOST=${SMTP_HOST} + ports: + - 8000:8001 + build: + context: ./backend + dockerfile: backend.dockerfile + args: + INSTALL_DEV: ${INSTALL_DEV-true} + volumes: + - ./backend/app:/app + + celeryworker: + tty: true + container_name: bemore-celeryworker + image: ${DOCKER_IMAGE_CELERYWORKER?Variable not set}:${TAG-latest} + depends_on: + - db + - queue + env_file: + - .env + volumes: + - ./backend/app:/app + environment: + # Allow explicit env var override for tests + - SMTP_HOST=${SMTP_HOST?Variable not set} + build: + context: ./backend + dockerfile: celeryworker.dockerfile + args: + INSTALL_DEV: ${INSTALL_DEV-true} + + +volumes: + app-db-data: diff --git a/justfile b/justfile index ecd707e..ab419b4 100644 --- a/justfile +++ b/justfile @@ -20,5 +20,5 @@ dev-logs: docker-compose -f docker-compose.dev.yml logs -f test: - INSTALL_DEV=true docker-compose up -d --build + docker-compose -f docker-compose.ci.yml up -d --build docker-compose exec -T backend poetry run pytest --cov=app --cov-report=term-missing --cov-report=html app/tests