#26 pharmacy: docker-compose - redis, mariadb
This commit is contained in:
3
road/.gitignore
vendored
3
road/.gitignore
vendored
@@ -35,3 +35,6 @@ out/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
###
|
||||
.env
|
||||
@@ -23,10 +23,10 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
// runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
|
||||
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
|
||||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
|
||||
3
road/database/Dockerfile
Normal file
3
road/database/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM mariadb:10
|
||||
|
||||
ENV TZ=Asia/Seoul
|
||||
13
road/database/config/mariadb.cnf
Normal file
13
road/database/config/mariadb.cnf
Normal file
@@ -0,0 +1,13 @@
|
||||
[client]
|
||||
default-character-set=utf8mb4
|
||||
|
||||
[mysql]
|
||||
default-character-set=utf8mb4
|
||||
|
||||
[mysqld]
|
||||
default-character-set=utf8mb4
|
||||
collation-server=utf8mb4_unicode_ci
|
||||
skip-character-set-client-handshake
|
||||
|
||||
[mysqldump]
|
||||
default-character-set=utf8mb4
|
||||
23
road/docker-compose-local.yml
Normal file
23
road/docker-compose-local.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
pharmacy-recommendation-redis:
|
||||
container_name: pharmacy-recommendation-redis
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
context: ./redis
|
||||
image: haerong22/pharmacy-recommendation-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
pharmacy-recommendation-database:
|
||||
container_name: pharmacy-recommendation-database
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
context: ./database
|
||||
image: haerong22/pharmacy-recommendation-database
|
||||
environment:
|
||||
- MARIADB_DATABASE=pharmacy-recommendation
|
||||
- MARIADB_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
|
||||
volumes:
|
||||
- ./database/config:/etc/mysql/conf.d
|
||||
ports:
|
||||
- "3306:3306"
|
||||
3
road/redis/Dockerfile
Normal file
3
road/redis/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM redis:6
|
||||
|
||||
ENV TZ=Asia/Seoul
|
||||
@@ -18,6 +18,18 @@ spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: local
|
||||
datasource:
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
url: jdbc:mariadb://localhost:3306/pharmacy-recommendation
|
||||
username: ${SPRING_DATASOURCE_USERNAME}
|
||||
password: ${SPRING_DATASOURCE_PASSWORD}
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: create
|
||||
show-sql: true
|
||||
|
||||
---
|
||||
spring:
|
||||
|
||||
Reference in New Issue
Block a user