| @@ -0,0 +1,10 @@ | |||||
| # 该镜像需要依赖的基础镜像 | |||||
| FROM openjdk:8-jdk-alpine | |||||
| # 指定维护者名称 | |||||
| MAINTAINER Mayday 420882008@qq.com | |||||
| VOLUME /tmp | |||||
| ARG JAR_FILE | |||||
| COPY ${JAR_FILE} app.jar | |||||
| COPY config config | |||||
| COPY deploy/yuqing/application.yml config/application.yml | |||||
| ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] | |||||
| @@ -0,0 +1,22 @@ | |||||
| version: "3.0" | |||||
| services: | |||||
| ngnix: #服务名称,名称可自定义 | |||||
| container_name: nginx #容器名称,可自定义 | |||||
| image: nginx:latest # 镜像名称 | |||||
| restart: always | |||||
| ports: # 容器和服务器对应的端口映射,每次新增一个站点之后一定要在这里把对应的端口映射加上,不然肯定会404 | |||||
| - "80:80" | |||||
| - "443:443" | |||||
| privileged: true | |||||
| volumes: #指定挂载目录 | |||||
| - /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf | |||||
| - /data/nginx/html/:/usr/share/nginx/html/ | |||||
| - /data/nginx/logs/:/var/log/nginx/ | |||||
| - /data/nginx/conf.d/:/etc/nginx/conf.d | |||||
| - /data/nginx/cert/:/home | |||||
| networks: | |||||
| - nginx | |||||
| networks: | |||||
| nginx: | |||||
| external: true | |||||
| @@ -0,0 +1,64 @@ | |||||
| # 1.设置舆情系统web访问端口,默认端口号8084 | |||||
| server: | |||||
| port: 8084 | |||||
| servlet: | |||||
| session: | |||||
| cookie: | |||||
| name: local-portal | |||||
| max-age: 3600 | |||||
| timeout: 3600 | |||||
| spring: | |||||
| thymeleaf: | |||||
| prefix: classpath:/templates/ | |||||
| cache: false | |||||
| mode: LEGACYHTML5 # 用非严格的 HTML | |||||
| encoding: UTF-8 | |||||
| servlet: | |||||
| content-type: text/html | |||||
| http: | |||||
| # 设置编码 | |||||
| encoding: | |||||
| force: true | |||||
| charset: UTF-8 | |||||
| enabled: true | |||||
| devtools: | |||||
| restart: | |||||
| enabled: true #热部署生效 | |||||
| application: | |||||
| name: stonedt-portal | |||||
| # 2.修改设置MySQL服务器地址和用户名及密码 | |||||
| datasource: | |||||
| druid: | |||||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||||
| url: jdbc:mysql://mysql:3306/stonedt_portal?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&useSSL=false | |||||
| username: root | |||||
| password: 123456 | |||||
| # 3.修改设置Redis服务器地址 | |||||
| redis: | |||||
| database: 0 | |||||
| host: redis | |||||
| port: 6379 | |||||
| max-active: 10000 | |||||
| max-idle: 10 | |||||
| max-wait: 100000 | |||||
| timeout: 100000 | |||||
| # flyway 自动建库建表设置 | |||||
| flyway: | |||||
| enabled: true | |||||
| locations: classpath:db/migration | |||||
| baseline-on-migrate: true | |||||
| mybatis: | |||||
| type-aliases-package: com.stonedt.intelligence.entity | |||||
| mapper-locations: classpath:mapper/*.xml | |||||
| logging: | |||||
| level: | |||||
| com.stonedt.intelligence.dao : debug | |||||
| @@ -0,0 +1,36 @@ | |||||
| version: "3" | |||||
| services: | |||||
| redis: | |||||
| image: redis:latest #镜像名称 | |||||
| container_name: redis #容器名称 | |||||
| restart: always #重启docker引擎后该容器也重启 | |||||
| volumes: #指定挂载目录 | |||||
| - /data/redis:/data | |||||
| mysql: | |||||
| environment: | |||||
| MYSQL_ROOT_PASSWORD: 123456 #root账号的密码 | |||||
| image: mysql:5.7 #镜像名称 | |||||
| container_name: db | |||||
| restart: always | |||||
| volumes: #指定挂载目录 | |||||
| - /data/mysql/data:/var/lib/mysql #数据挂载 | |||||
| - /data/mysql/init/:/docker-entrypoint-initdb.d/ #初始化数据 | |||||
| yuqing: | |||||
| image: yuqing:latest | |||||
| container_name: yuqing | |||||
| ports: | |||||
| - "8084:8084" | |||||
| links: | |||||
| - redis | |||||
| - mysql | |||||
| depends_on: | |||||
| - redis | |||||
| - mysql | |||||
| networks: | |||||
| # - nginx | |||||
| - default | |||||
| # 如果使用nginx代理需要创建一个network并执行nginx下的docker-compose | |||||
| #networks: | |||||
| # nginx: | |||||
| # external: true | |||||
| @@ -252,6 +252,20 @@ | |||||
| </nonFilteredFileExtensions> | </nonFilteredFileExtensions> | ||||
| </configuration> | </configuration> | ||||
| </plugin> | </plugin> | ||||
| <plugin> | |||||
| <groupId>com.spotify</groupId> | |||||
| <artifactId>dockerfile-maven-plugin</artifactId> | |||||
| <version>1.4.9</version> | |||||
| <configuration> | |||||
| <!--使用maven, gorupId,artifactId,和tag用版本 --> | |||||
| <repository>yuqing</repository> | |||||
| <tag>latest</tag> | |||||
| <buildArgs> | |||||
| <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> | |||||
| </buildArgs> | |||||
| </configuration> | |||||
| </plugin> | |||||
| </plugins> | </plugins> | ||||
| <resources> | <resources> | ||||
| <resource> | <resource> | ||||