Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
55 lines (54 loc) · 1.44 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
55 lines (54 loc) · 1.44 KB
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
50
51
52
53
54
55
version: '3'
services:
mcp-mysql-server:
build:
context: mcp-mysql-server
dockerfile: ./Dockerfile
ports:
- "8000:8000"
networks:
backend_net:
ipv4_address: 172.28.1.3
expose:
# Opens port 8080 on the container
- '8000'
environment:
- MYSQL_HOST=172.28.1.2
- MYSQL_PORT=${MYSQL_PORT}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
tty: true
mysql:
image: docker.io/mysql:8.0.18
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci','--default-authentication-plugin=mysql_native_password']
restart: always
environment:
MYSQL_DATABASE: 'testdatabase'
# So you don't have to use root, but you can if you like
MYSQL_USER: 'testuser'
# You can use whatever password you like
MYSQL_PASSWORD: 'password'
# Password for root access
MYSQL_ROOT_PASSWORD: 'password'
ports:
# <Port exposed> : < MySQL Port running inside container>
- '3306:3306'
expose:
# Opens port 3306 on the container
- '3306'
# Where our data will be persisted
volumes:
- /opt/mysql/mysql-db-data:/var/lib/mysql
networks:
backend_net:
ipv4_address: 172.28.1.2
# Names our volume
volumes:
mysql-db-data:
networks:
backend_net:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16