-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (47 loc) · 1.31 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: '3.9'
services:
data:
image: mysql:8-oracle
container_name: 'todos-data'
restart: unless-stopped
env_file: ./.env
ports:
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
environment:
- MYSQL_ROOT_PASSWORD=$MYSQLDB_ROOT_PASSWORD
- MYSQL_DATABASE=$MYSQLDB_DATABASE
volumes:
- db:/var/lib/mysql
app:
depends_on:
- data
build: ./todos-app
image: 'todos-app:1.1.0'
container_name: 'todos-app'
restart: on-failure
env_file: ./.env
ports:
- $SPRING_LOCAL_PORT:$SPRING_DOCKER_PORT
environment:
SPRING_APPLICATION_JSON: '{
"spring.datasource.url" : "jdbc:mysql://data:$MYSQLDB_DOCKER_PORT/$MYSQLDB_DATABASE",
"spring.datasource.username" : "$MYSQLDB_USER",
"spring.datasource.password" : "$MYSQLDB_ROOT_PASSWORD",
"spring.jpa.hibernate.ddl-auto" : "update",
"spring.jpa.properties.hibernate.dialect" : "org.hibernate.dialect.MySQLDialect"
}'
stdin_open: true
tty: true
proxy:
depends_on:
- app
image: nginx:1.24-alpine
container_name: 'todos-proxy'
restart: always
env_file: ./.env
ports:
- $NGINX_LOCAL_PORT:$NGINX_DOCKER_PORT
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
volumes:
db: