-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(castor): add local docker-compose db and migrations
- Loading branch information
Pat Losoponkul
committed
Sep 13, 2022
1 parent
e4bc0d0
commit 2d5a447
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# Castor BB | ||
# Castor BB service | ||
|
||
## Quickstart | ||
|
||
__Running Castor locally for development__ | ||
|
||
```bash | ||
docker-compose -f docker/docker-compose-loca.yaml up -d | ||
sbt api-server/run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: "3.9" | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
restart: always | ||
environment: | ||
POSTGRES_DB: castor | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- pg_data_castor_db:/var/lib/postgresql/data | ||
|
||
# delay to ensure DB is up before apply migrations | ||
db_init_delay: | ||
image: alpine:3 | ||
command: sleep 5 | ||
depends_on: | ||
db: | ||
condition: service_started | ||
|
||
db_init: | ||
image: flyway/flyway:9.3.0-alpine | ||
volumes: | ||
- $PWD/migrations/sql:/flyway/sql | ||
command: -url=jdbc:postgresql://db:5432/castor?user=postgres&password=postgres migrate | ||
depends_on: | ||
db_init_delay: | ||
condition: service_completed_successfully | ||
|
||
volumes: | ||
pg_data_castor_db: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE TABLE public.published_did_operations( | ||
"foo" VARCHAR(100) NOT NULL, | ||
"bar" VARCHAR(100) NOT NULL | ||
); |