Skip to content

Instantly share code, notes, and snippets.

@javatodev
Created January 8, 2021 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javatodev/35e89dbff036a499bc908b30deac10ea to your computer and use it in GitHub Desktop.
Save javatodev/35e89dbff036a499bc908b30deac10ea to your computer and use it in GitHub Desktop.
Docker Compose For Spring Boot With MySQL
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
#version: "3.7"
#services:
# api_service:
# build: .
# restart: always
# ports:
# - 8080:8080
# depends_on:
# - postgres_db
# links:
# - postgres_db:database
# postgres_db:
# image: "postgres:11.4"
# restart: always
# ports:
# - 5432:5432
# environment:
# POSTGRES_DB: java_to_dev_app_db
# POSTGRES_PASSWORD: nE5kMc7JCGNqwDQM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment