Docker setting

This commit is contained in:
crusader 2017-07-31 11:27:39 +09:00
parent 776503b347
commit 5b56acf72b
3 changed files with 54 additions and 30 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
MAINTAINER Loafle <rnd@loafle.com>
ADD target/lib /service/lib
ADD target/com.loafle.overflow.overflow_server.jar /service/
ENTRYPOINT ["/usr/bin/java", "-jar", "/service/com.loafle.overflow.overflow_server.jar"]

76
pom.xml
View File

@ -150,6 +150,23 @@
</extensions> </extensions>
<plugins> <plugins>
<!-- Copy Maven dependencies into target/lib/ -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<overWriteReleases>false</overWriteReleases>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.xolstice.maven.plugins</groupId> <groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId> <artifactId>protobuf-maven-plugin</artifactId>
@ -201,37 +218,38 @@
<plugin> <plugin>
<groupId>com.spotify</groupId> <groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId> <artifactId>dockerfile-maven-plugin</artifactId>
<version>1.0.0</version> <version>1.3.4</version>
<configuration> <executions>
<imageName>docker.loafle.net/overflow/${project.artifactId}</imageName> <execution>
<dockerDirectory>src/main/docker</dockerDirectory> <id>build</id>
<!-- optionally overwrite tags every time image is built with docker:build --> <goals>
<forceTags>true</forceTags> <goal>build</goal>
<imageTags> </goals>
<imageTag>${project.version}</imageTag> </execution>
<imageTag>latest</imageTag> <execution>
</imageTags> <id>tag</id>
<resources> <goals>
<resource> <goal>tag</goal>
<targetPath>/</targetPath> </goals>
<directory>${project.build.directory}</directory> <configuration>
<include>${project.build.finalName}.jar</include> <repository>docker.loafle.net/overflow/${project.build.finalName}</repository>
</resource> <tag>${project.version}</tag>
</resources> </configuration>
</configuration> </execution>
</executions>
</plugin> </plugin>
<plugin> <!--<plugin>-->
<groupId>org.apache.maven.plugins</groupId> <!--<groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-assembly-plugin</artifactId> <!--<artifactId>maven-assembly-plugin</artifactId>-->
<version>2.2.1</version> <!--<version>2.2.1</version>-->
<configuration> <!--<configuration>-->
<descriptorRefs> <!--<descriptorRefs>-->
<descriptorRef>jar-with-dependencies</descriptorRef> <!--<descriptorRef>jar-with-dependencies</descriptorRef>-->
</descriptorRefs> <!--</descriptorRefs>-->
</configuration> <!--</configuration>-->
</plugin> <!--</plugin>-->
</plugins> </plugins>
</build> </build>

View File

@ -1 +0,0 @@
FROM openjdk:8-jdk-alpine