- Use multi-stage build for the application image - Utilize connection pool init timeout for waiting on database container startup, "docker-compose-wait" dependency is no longer required - Override database host through environment variable - used in docker-compose - Rename database scripts for explicit ordering (db container loads them alphabetically)
23 lines
463 B
YAML
23 lines
463 B
YAML
version: '3'
|
|
services:
|
|
maplestory:
|
|
build: .
|
|
depends_on:
|
|
- db
|
|
ports:
|
|
- "8484:8484"
|
|
- "7575-7577:7575-7577"
|
|
environment:
|
|
DB_HOST: "db"
|
|
|
|
db:
|
|
image: mysql:8.0.23
|
|
environment:
|
|
MYSQL_RANDOM_ROOT_PASSWORD: "true"
|
|
MYSQL_DATABASE: "cosmic"
|
|
MYSQL_USER: "cosmic_server"
|
|
MYSQL_PASSWORD: "snailshell"
|
|
volumes:
|
|
- ./docker-db-data:/var/lib/mysql
|
|
- ./sql:/docker-entrypoint-initdb.d
|