Add docker image build

This commit is contained in:
2025-11-10 15:47:05 +01:00
parent 66609ab25d
commit 7496a77213
4 changed files with 45 additions and 4 deletions

View File

@@ -1,4 +1,18 @@
services:
app:
build:
context: ./app
ports:
- "8080:8080"
depends_on:
mysql:
condition: service_healthy
mongo:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://root:cms@mysql:3306/cms
SPRING_DATA_MONGODB_URI: mongodb://root:cms@mongo:27017/prescriptions?authSource=admin
mysql:
image: mysql:8.0
container_name: mysql
@@ -9,6 +23,11 @@ services:
- mysql-data:/var/lib/mysql
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysql", "-uroot", "-pcms", "-e", "SELECT 1"]
interval: 10s
timeout: 5s
retries: 5
mongo:
image: mongo:8.2.1
@@ -21,6 +40,11 @@ services:
- mongodb-data:/data/db
ports:
- "27017:27017"
healthcheck:
test: [ "CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 })" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql-data: