Skip to content

Commit

Permalink
fixing DB_NAME bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MadelaineJ committed Jan 30, 2024
1 parent 3316f79 commit fad34a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ web:

mig:
@echo "Creating database and applying migrations for medical..."
@DB_NAME=medical docker compose up migs
@DB_NAME=sanctuary docker compose up migs
@docker compose up migs
@docker compose up migssanctuary

automig:
@echo "Autogenerating migration in docker context"
Expand Down
19 changes: 17 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,23 @@ services:
env_file: app/api/.env
environment:
- POSTGRES_HOST=db
- DB_NAME=${DB_NAME}
command: bash -c "cd /app/api && alembic --name=${DB_NAME} upgrade head"
command: bash -c "cd /app/api && alembic --name=medical upgrade head"
volumes:
# Mount local codebase to reflect changes for local dev
- ./app/api:/app/api
depends_on:
db:
condition: service_healthy

migssanctuary:
container_name: migssanctuary
build:
context: app/api/
dockerfile: Dockerfile.dev
env_file: app/api/.env
environment:
- POSTGRES_HOST=db
command: bash -c "cd /app/api && alembic --name=sanctuary upgrade head"
volumes:
# Mount local codebase to reflect changes for local dev
- ./app/api:/app/api
Expand Down

0 comments on commit fad34a5

Please sign in to comment.