version: "3.9" services: mysql: image: mysql:8.0 container_name: wallet-mysql restart: unless-stopped environment: MYSQL_DATABASE: walletdb MYSQL_USER: wallet_user MYSQL_PASSWORD: wallet_password MYSQL_ROOT_PASSWORD: rootpassword ports: - "3306:3306" volumes: - mysql_data:/var/lib/mysql command: > --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci wallet-service: build: . container_name: wallet-service restart: unless-stopped depends_on: - mysql ports: - "8080:8080" environment: SPRING_PROFILES_ACTIVE: docker SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/walletdb SPRING_DATASOURCE_USERNAME: wallet_user SPRING_DATASOURCE_PASSWORD: wallet_password JAVA_OPTS: "-Xms256m -Xmx512m" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health/readiness"] interval: 10s timeout: 5s retries: 5 volumes: mysql_data: