Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
ityouknow committed Mar 26, 2018
1 parent 0b85e80 commit d661606
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/src/main/resources/application-docker.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###### db config start ######
spring.datasource.url=jdbc:mysql://mysql:3306/favorites
spring.datasource.url=jdbc:mysql://mysql:3306/favorites?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=favorites
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=30
Expand All @@ -16,7 +16,7 @@ logging.level.org.springframework.web=INFO
logging.level.org.hibernate=in
###### logging config end ######

favorites.base.path=http://192.168.0.x/
favorites.base.path=http://192.168.0.54/

###### file path begin ######
static.url=/usr/share/nginx/html/
Expand Down
11 changes: 5 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ services:
- ./nginx/conf.d:/etc/nginx/conf.d

mysql:
container_name: favorites-mysql
image: mysql/mysql-server:5.7
build: ./mysql
environment:
MYSQL_DATABASE: favorites
MYSQL_ROOT_PASSWORD: favorites
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: favorites
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: '%'
ports:
- "3306:3306"
restart: always

app:
restart: always
build: ./app
Expand Down
2 changes: 2 additions & 0 deletions mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM mysql/mysql-server:5.7
COPY mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
11 changes: 11 additions & 0 deletions mysql/mysqld_charset.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[client]
default-character-set=utf8mb4

[mysql]
default-character-set=utf8mb4

[mysqld]
skip-character-set-client-handshake
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
init-connect=SET NAMES utf8mb4

0 comments on commit d661606

Please sign in to comment.