Skip to content

Commit

Permalink
Update docker-compose.yml (#276)
Browse files Browse the repository at this point in the history
* Remove deprecated version from docker-compose

* Ensure server waits for database to be healthy before connecting

* Make server restart in case of failure

* Force docker-compose to build with latest Dockerfiles
  • Loading branch information
bcollazo authored Jul 4, 2024
1 parent 2a4f078 commit 29ba7cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.3"
services:
db:
image: postgres
Expand All @@ -8,8 +7,12 @@ services:
- POSTGRES_DB=catanatron_db
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -d postgresql://catanatron:victorypoint@db:5432/catanatron_db"]
interval: 5s
timeout: 5s
retries: 5
server:
image: bcollazo/catanatron-server:latest
build:
context: .
dockerfile: Dockerfile.web
Expand All @@ -19,12 +22,13 @@ services:
ports:
- 5000:5000
stdin_open: true
restart: always
volumes:
- .:/app
depends_on:
- "db"
db:
condition: service_healthy
react-ui:
image: bcollazo/catanatron-react-ui:latest
build: ./ui
ports:
- 3000:3000
Expand Down

0 comments on commit 29ba7cc

Please sign in to comment.