Skip to content

Commit bbe427f

Browse files
committed
add docker and docker compose files and build goal
1 parent 2f4556f commit bbe427f

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

backend/pom.xml

+32
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
<version>1.0.1</version>
6161
</dependency>
6262

63+
<dependency>
64+
<groupId>fr.rtone</groupId>
65+
<artifactId>frontend</artifactId>
66+
<version>0.0.1-SNAPSHOT</version>
67+
<scope>runtime</scope>
68+
</dependency>
69+
6370
</dependencies>
6471

6572

@@ -76,6 +83,31 @@
7683
</execution>
7784
</executions>
7885
</plugin>
86+
<plugin>
87+
<groupId>com.spotify</groupId>
88+
<artifactId>docker-maven-plugin</artifactId>
89+
<version>0.4.10</version>
90+
<executions>
91+
<execution>
92+
<id>build-image</id>
93+
<phase>install</phase>
94+
<goals>
95+
<goal>build</goal>
96+
</goals>
97+
</execution>
98+
</executions>
99+
<configuration>
100+
<imageName>sigfox-iot</imageName>
101+
<dockerDirectory>docker-compose</dockerDirectory>
102+
<resources>
103+
<resource>
104+
<targetPath>/</targetPath>
105+
<directory>${project.build.directory}</directory>
106+
<include>${project.build.finalName}.war</include>
107+
</resource>
108+
</resources>
109+
</configuration>
110+
</plugin>
79111
</plugins>
80112
</build>
81113

docker-compose/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM openjdk:8-jre-alpine
2+
3+
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
4+
APP_SLEEP=0
5+
6+
# add directly the war
7+
ADD *.war /app.war
8+
9+
VOLUME /tmp
10+
EXPOSE 8080
11+
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
12+
sleep ${APP_SLEEP} && \
13+
java -Djava.security.egd=file:/dev/./urandom -jar /app.war

docker-compose/docker-compose.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '2'
2+
services:
3+
sigfox-iot-app:
4+
image: sigfox-iot
5+
links:
6+
- sigfox-mysql:mysql
7+
environment:
8+
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/sigfox?useUnicode=true&characterEncoding=utf8&useSSL=false
9+
- SPRING_DATASOURCE_USERNAME=root
10+
- SPRING_DATASOURCE_PASSWORD=
11+
- APP_SLEEP=10
12+
ports:
13+
- 8080:8080
14+
sigfox-mysql:
15+
image: mysql:5.7.13
16+
environment:
17+
- MYSQL_USER=root
18+
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
19+
- MYSQL_DATABASE=sigfox
20+
command: mysqld --lower_case_table_names=1 --skip-ssl

0 commit comments

Comments
 (0)