This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
49 lines (49 loc) · 1.51 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ------------------------------------------------------------------------------
# Ref: https://docs.docker.com/compose/compose-file/
#
# Setup:
# Copy .env.example to .env and modify values as required.
# MYSQL_ROOT_PASSWORD value is required when using a persistent data volume.
# docker-compose build
# docker-compose down
#
# Run Default example:
# docker-compose up -d
#
# Check service logs:
# docker-compose logs mysql
#
# Usage:
# docker-compose exec mysql mysqladmin -p --help
# docker-compose exec mysql mysql -p
# docker exec -i $(docker-compose ps -q mysql) mysql < setup.sql
#
# Reset - bring down services + delete volume data:
# docker-compose down -v
# ------------------------------------------------------------------------------
version: "3.0"
volumes:
data-mysql:
driver: "local"
services:
mysql:
build:
context: "."
dockerfile: "Dockerfile"
environment:
MYSQL_INIT_LIMIT: "${MYSQL_INIT_LIMIT}"
MYSQL_INIT_SQL: "${MYSQL_INIT_SQL}"
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
MYSQL_ROOT_PASSWORD_HASHED: "${MYSQL_ROOT_PASSWORD_HASHED}"
MYSQL_SUBNET: "${MYSQL_SUBNET}"
MYSQL_USER: "${MYSQL_USER}"
MYSQL_USER_DATABASE: "${MYSQL_USER_DATABASE}"
MYSQL_USER_PASSWORD: "${MYSQL_USER_PASSWORD}"
MYSQL_USER_PASSWORD_HASHED: "${MYSQL_USER_PASSWORD_HASHED}"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-mysql:latest"
ports:
- "3306:3306"
restart: "always"
volumes:
- "data-mysql:/var/lib/mysql"