Skip to content

Commit

Permalink
Add docker-compose.ci.yaml and update justfile for CI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
AndPuQing committed Jan 28, 2024
1 parent 1568599 commit a12e197
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
67 changes: 67 additions & 0 deletions docker-compose.ci.yaml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a12e197

Please sign in to comment.