Created
January 8, 2021 17:30
-
-
Save javatodev/02fbf2b74f89f1dfe138e60b5e164055 to your computer and use it in GitHub Desktop.
Docker compose for Spring Boot MySQL using Depends On
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
api_service: | |
build: . | |
restart: always | |
ports: | |
- 8080:8080 | |
depends_on: | |
- mysql_db | |
command: sh -c './wait-for mysql_db:3306 -- npm start' | |
mysql_db: | |
image: "mysql:8.0" | |
restart: always | |
ports: | |
- 3307:3306 | |
environment: | |
MYSQL_DATABASE: java_to_dev_app_db | |
MYSQL_USER: java_to_dev | |
MYSQL_PASSWORD: nE5kMc7JCGNqwDQM | |
MYSQL_ROOT_PASSWORD: nE5kMc7JCGNqwDQN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment