-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
48 lines (40 loc) · 1.62 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
version: '3.3'
services:
#service 1: definition of mysql database
db:
image: mysql:latest
container_name: mysql-db2
environment:
- MYSQL_ROOT_PASSWORD=mukit
- MYSQL_USER=root
ports:
- "3306:3306"
restart: always
#service 2: definition of phpMyAdmin
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: my-php-myadmin
ports:
- "8082:80"
restart: always
depends_on:
- db
environment:
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: mukit
#service 3: definition of your spring-boot app
customerservice: #it is just a name, which will be used only in this file.
image: customer-service #name of the image after dockerfile executes
container_name: customer-service-app #name of the container created from docker image
build:
context: . #docker file path (. means root directory)
dockerfile: Dockerfile #docker file name
ports:
- "8084:8084" #docker containter port with your os port
restart: always
depends_on: #define dependencies of this app
- db #dependency name (which is defined with this name 'db' in this file earlier)
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql-db2:3306/customer?createDatabaseIfNotExist=true
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: mukit