Skip to content

Commit

Permalink
fix: first start db creation
Browse files Browse the repository at this point in the history
  • Loading branch information
KisCsaj68 committed Oct 3, 2024
1 parent 481b10e commit 4075cf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@ api-user-loadtest:
.PHONY: api-order-loadtest
api-order-loadtest:
./scripts/api_orders.sh

.PHONY: create-database
create-database:
docker-compose start postgres
docker exec postgres psql -U postgres -c "CREATE DATABASE quokka;"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,6 @@ export PROMETHEUS_MULTIPROC_DIR="/tmp/metrics" <br>

Those setup will allows you to connect to Alpaca streaming, and use the predefined RabbitMQ queues in the application.

<br>When you freshly clone the repository before the first start you need to create the DB. Run the `make create-database` command to start postgres container and create the needed database.<br>

Adjust `spring.jpa.hibernate.ddl-auto = create` in one of the component's application.properties to auto create the DB schema. When schema is created, change it back to `none` or `validate`.
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ services:
image: postgres:14
environment:
- POSTGRES_PASSWORD=asdqwe
healthcheck:
test: ["CMD-SHELL", "psql -U postgres"]
interval: 2s
timeout: 10s
retries: 100
start_period: 10s

frontend:
container_name: frontend
image: quokka/frontend
Expand Down

0 comments on commit 4075cf0

Please sign in to comment.