-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (59 loc) · 2.02 KB
/
docker-compose.yml
File metadata and controls
66 lines (59 loc) · 2.02 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
56
57
58
59
60
61
62
63
64
65
66
version: '3.3'
services:
#service 1: definition of mysql database
db:
image: mysql:latest
container_name: scanbook-db
environment:
- MYSQL_ROOT_PASSWORD=spring
- MYSQL_DATABASE=library
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: spring
#service 3: definition for scan book rest api
sacnbookapiservice: #it is just a name, which will be used only in this file.
image: scanbook-service #name of the image after dockerfile executes
container_name: scanbook-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://scanbook-db:3306/library?createDatabaseIfNotExist=true
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: spring
frontendservice:
image: scanbook-ui
container_name: scanbook-ui
build:
context: ui
dockerfile: Dockerfile
ports:
- 3000:3000
restart: always
depends_on:
- sacnbookapiservice
environment:
api_endpoint: http://localhost:8084/books
mysql_seeding:
build: seedData
restart: always
depends_on:
- db