-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
48 lines (44 loc) · 1.24 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.9"
services:
database:
container_name: database
image: mysql:8.0.33
restart: always
env_file:
- .env # Use the .env file for environment variables
environment:
MYSQL_DATABASE: springbootsecurityexample
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_ROOT_HOST: '%'
MYSQL_PORT: 3307
volumes:
- ./db:/var/lib/mysql
ports:
- "3307:3306"
networks:
- springbootsecurityexampleNetwork
springbootsecurityexample:
image: 'springbootsecurityexample:latest'
build:
context: .
dockerfile: Dockerfile
container_name: springbootsecurity
restart: on-failure
env_file:
- .env # Use the .env file for environment variables
ports:
- "1223:1223"
environment:
- server.port=1223
- spring.datasource.username=${DATABASE_USERNAME}
- spring.datasource.password=${DATABASE_PASSWORD}
- SECURITY_DB_IP=database
- SECURITY_DB_PORT=3307
- spring.datasource.url=jdbc:mysql://host.docker.internal:3307/springbootsecurityexample
depends_on:
- database
networks:
- springbootsecurityexampleNetwork
networks:
springbootsecurityexampleNetwork: