Skip to content

Instantly share code, notes, and snippets.

@javatodev
Created January 11, 2021 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javatodev/8ad0bb6a571d74e8ed966a79a55e1c7b to your computer and use it in GitHub Desktop.
Save javatodev/8ad0bb6a571d74e8ed966a79a55e1c7b to your computer and use it in GitHub Desktop.
Docker compose for Spring Boot with MariaDB
#version: "3.7"
#services:
# api_service:
# build: .
# restart: always
# ports:
# - 8080:8080
# depends_on:
# - maria_db
# links:
# - maria_db:app_db
# maria_db:
# image: "mariadb:10.5.8"
# 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:
- maria_db
command: sh -c './wait-for mysql_db:3306 -- npm start'
maria_db:
image: "mariadb:10.5.8"
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