Skip to content

Commit

Permalink
Add server docker logpath
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer authored and terwer committed Mar 14, 2019
1 parent d3e8be4 commit 7f9df91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ services:
build:
context: ./
dockerfile: ./jvue-server/Dockerfile
ports:
- "8081:8081"
working_dir: /app
command: mvn clean spring-boot:run -Dspring-boot.run.profiles=docker -DskipTests
volumes:
- ./jvue-server:/app
- ./data/maven/.m2:/root/.m2
- ./data/server/logs:/logs
restart: always
4 changes: 2 additions & 2 deletions jvue-mysql/init/init.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 数据库已经配置,这里不指定
-- 数据库已经配置,这里不指定
-- DROP DATABASE IF EXISTS testbugucms;
-- CREATE DATABASE testbugucms CHARACTER SET utf8 COLLATE utf8_general_ci;
USE testbugucms;

# 用户已经指定,不要创建
-- 用户已经指定,不要创建
-- CREATE USER 'test'@'%' IDENTIFIED BY '123456';
-- GRANT All privileges ON *.* TO '123456'@'%';

Expand Down
22 changes: 0 additions & 22 deletions jvue-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,28 +150,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- dockerfile-maven-plugin -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>spotify/foobar</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
4 changes: 4 additions & 0 deletions jvue-server/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="logFilePath" value="${catalina.base}/logs" />
</springProfile>
<springProfile name="docker">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="logFilePath" value="/logs" />
</springProfile>

<property name="log.context.name" value="JVueApplication" />
<property name="log.charset" value="UTF-8" />
Expand Down

0 comments on commit 7f9df91

Please sign in to comment.