Skip to content

Commit

Permalink
Fix: Docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
mateus3009 committed Jul 16, 2024
1 parent 511803d commit ab4157a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
name: stock-api

services:
stock_api:
Expand All @@ -8,16 +8,22 @@ services:
context: .
dockerfile: Dockerfile
depends_on:
- stock_db
stock_db:
condition: service_healthy
environment:
DB_ENDPOINT: stock_db:5432
DB_NAME: selforder
DB_NAME: stock
DB_USERNAME: selforder
DB_PASSWORD: self@Order123!
ADMIN_ACCESS_TOKEN: token
ports:
- "8081:8081"
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8081/actuator/health"]
interval: 10s
timeout: 5s
retries: 5

stock_db:
image: postgres:15.4
Expand All @@ -31,6 +37,11 @@ services:
ports:
- "5432:5432"
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5

volumes:
stock_db:
Expand Down

0 comments on commit ab4157a

Please sign in to comment.