This commit is contained in:
冷冷 2020-01-17 20:50:49 +08:00
commit 35d7908547
15 changed files with 68 additions and 23 deletions

View File

@ -4,6 +4,6 @@ MAINTAINER lengleng(wangiegie@gmail.com)
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
COPY ./db/pig.sql /docker-entrypoint-initdb.d COPY ./pig.sql /docker-entrypoint-initdb.d
COPY ./db/pig_config.sql /docker-entrypoint-initdb.d COPY ./pig_config.sql /docker-entrypoint-initdb.d

View File

@ -2,8 +2,7 @@ version: '2'
services: services:
pig-mysql: pig-mysql:
build: build:
context: ./ context: ./db
dockerfile: ./db/Dockerfile
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
restart: always restart: always
@ -22,8 +21,7 @@ services:
pig-register: pig-register:
build: build:
context: ./ context: ./pig-register
dockerfile: ./pig-register/Dockerfile
restart: always restart: always
ports: ports:
- 8848:8848 - 8848:8848
@ -33,8 +31,7 @@ services:
pig-gateway: pig-gateway:
build: build:
context: ./ context: ./pig-gateway
dockerfile: ./pig-gateway/Dockerfile
restart: always restart: always
ports: ports:
- 9999:9999 - 9999:9999
@ -44,8 +41,7 @@ services:
pig-auth: pig-auth:
build: build:
context: ./ context: ./pig-auth
dockerfile: ./pig-auth/Dockerfile
restart: always restart: always
container_name: pig-auth container_name: pig-auth
hostname: pig-auth hostname: pig-auth
@ -53,8 +49,7 @@ services:
pig-upms: pig-upms:
build: build:
context: ./ context: ./pig-upms/pig-upms-biz
dockerfile: ./pig-upms/pig-upms-biz/Dockerfile
restart: always restart: always
container_name: pig-upms container_name: pig-upms
hostname: pig-upms hostname: pig-upms
@ -62,8 +57,7 @@ services:
pig-monitor: pig-monitor:
build: build:
context: ./ context: ./pig-monitor
dockerfile: ./pig-monitor/Dockerfile
restart: always restart: always
ports: ports:
- 5001:5001 - 5001:5001
@ -73,8 +67,7 @@ services:
pig-codegen: pig-codegen:
build: build:
context: ./ context: ./pig-codegen
dockerfile: ./pig-codegen/Dockerfile
restart: always restart: always
container_name: pig-codegen container_name: pig-codegen
hostname: pig-codegen hostname: pig-codegen

View File

@ -10,6 +10,6 @@ WORKDIR /pig-auth
EXPOSE 3000 EXPOSE 3000
ADD ./pig-auth/target/pig-auth.jar ./ ADD ./target/pig-auth.jar ./
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-auth.jar CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-auth.jar

View File

@ -85,6 +85,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -10,6 +10,6 @@ WORKDIR /pig-codegen
EXPOSE 5003 EXPOSE 5003
ADD ./pig-codegen/target/pig-codegen.jar ./ ADD ./target/pig-codegen.jar ./
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-codegen.jar CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-codegen.jar

View File

@ -88,6 +88,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -10,6 +10,6 @@ WORKDIR /pig-gateway
EXPOSE 9999 EXPOSE 9999
ADD ./pig-gateway/target/pig-gateway.jar ./ ADD ./target/pig-gateway.jar ./
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-gateway.jar CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-gateway.jar

View File

@ -80,6 +80,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -10,6 +10,6 @@ WORKDIR /pig-monitor
EXPOSE 5001 EXPOSE 5001
ADD ./pig-monitor/target/pig-monitor.jar ./ ADD ./target/pig-monitor.jar ./
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-monitor.jar CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-monitor.jar

View File

@ -69,6 +69,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -10,8 +10,7 @@ WORKDIR /pig-register
EXPOSE 8848 EXPOSE 8848
ADD ./pig-register/target/pig-register.jar ./ ADD ./target/pig-register.jar ./
CMD sleep 30;java -Djava.security.egd=file:/dev/./urandom -jar pig-register.jar CMD sleep 30;java -Djava.security.egd=file:/dev/./urandom -jar pig-register.jar

View File

@ -70,6 +70,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
<resources> <resources>
<resource> <resource>

View File

@ -10,6 +10,6 @@ WORKDIR /pigx-upms
EXPOSE 4000 EXPOSE 4000
ADD ./pig-upms/pig-upms-biz/target/pig-upms-biz.jar ./ ADD ./target/pig-upms-biz.jar ./
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-upms-biz.jar CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-upms-biz.jar

View File

@ -88,6 +88,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins> </plugins>
</build> </build>

29
pom.xml
View File

@ -48,6 +48,12 @@
<jasypt.version>2.1.0</jasypt.version> <jasypt.version>2.1.0</jasypt.version>
<swagger.fox.version>2.9.2</swagger.fox.version> <swagger.fox.version>2.9.2</swagger.fox.version>
<security.oauth.version>2.3.6.RELEASE</security.oauth.version> <security.oauth.version>2.3.6.RELEASE</security.oauth.version>
<docker.registry>http://172.17.0.111:2375</docker.registry>
<docker.host>172.17.0.111</docker.host>
<docker.namespace>library</docker.namespace>
<docker.username>admin</docker.username>
<docker.password>Harbor12345</docker.password>
<docker.plugin.version>0.32.0</docker.plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -180,6 +186,29 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.plugin.version}</version>
<configuration>
<dockerHost>${docker.host}</dockerHost>
<registry>${docker.registry}</registry>
<authConfig>
<push>
<username>${docker.username}</username>
<password>${docker.password}</password>
</push>
</authConfig>
<images>
<image>
<name>${docker.host}/${docker.namespace}/${project.name}:${project.version}</name>
<build>
<dockerFile>${project.basedir}/Dockerfile</dockerFile>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>