forked from langhsu/mblog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xulang
committed
Jan 23, 2019
1 parent
dc25613
commit e9bf70b
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM maven:3.5.4-jdk-8 | ||
MAINTAINER langhsu | ||
|
||
ENV TZ=Asia/Shanghai mysql_user="root" mysql_password="root" | ||
RUN mkdir /app && ln -sf /usr/share/zoneinfo/{TZ} /etc/localtime && echo "{TZ}" > /etc/timezone | ||
|
||
WORKDIR /app | ||
ADD mblog-latest.jar mblog-latest.jar | ||
ENTRYPOINT ["java", "-jar", "/opt/mblog/mblog-latest.jar", "--spring.datasource.username=${mysql_user}","--spring.datasource.password=${mysql_password}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3' | ||
services: | ||
mysql: | ||
container_name: mblog-mysql | ||
image: mysql/mysql-server:5.7 | ||
expose: | ||
- "3306" | ||
volumes: | ||
- ./src/main/resources/db/migration:/docker-entrypoint-initdb.d | ||
- ./mysql/mysql_data:/var/lib/mysql | ||
restart: always | ||
|
||
server: | ||
container_name: mblog | ||
build: . | ||
working_dir: /app | ||
environment: | ||
TZ: Asia/Shanghai | ||
volumes: | ||
- ./:/app | ||
- ~/.m2:/root/.m2 | ||
- ./logs:/app/logs | ||
ports: | ||
- "80:8080" | ||
command: mvn clean spring-boot:run -Dspring-boot.run.profiles=mysql -Dmaven.test.skip=true | ||
depends_on: | ||
- mysql | ||
restart: always |