File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ FROM maven:3-jdk-8 as builder
33COPY . /tmp/pattern-atlas-api
44WORKDIR /tmp/pattern-atlas-api
55RUN mvn package -DskipTests
6+ RUN mv target/patternatlas.api-1.2.0-SNAPSHOT.jar target/patternatlas.api-1.2.0-SNAPSHOT-no-hal-explorer.jar
7+ RUN mvn package -DskipTests -PHAL_EXPLORER
68
79
810FROM openjdk:8
@@ -15,16 +17,19 @@ ENV JDBC_DATABASE_USERNAME postgres
1517ENV JDBC_DATABASE_PASSWORD postgres
1618ENV JDBC_DATABASE_NAME postgres
1719ENV JDBC_DATABASE_PORT 5060
20+ ENV HAL_EXPLORER true
1821
1922RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
2023 && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
2124 && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
2225
2326EXPOSE ${API_PORT}
2427COPY --from=builder /tmp/pattern-atlas-api/target/patternatlas.api-1.2.0-SNAPSHOT.jar /var/www/java/api.jar
28+ COPY --from=builder /tmp/pattern-atlas-api/target/patternatlas.api-1.2.0-SNAPSHOT-no-hal-explorer.jar /var/www/java/api_no_hal_explorer.jar
2529
2630ADD .docker/application.properties.tpl /var/www/java/application.properties.tpl
2731
2832CMD dockerize -template /var/www/java/application.properties.tpl:/var/www/java/application.properties \
2933 && cd /var/www/java/ \
30- && java -jar api.jar
34+ && if [ $HAL_EXPLORER = "true" ]; then java -jar api.jar; else java -jar api_no_hal_explorer.jar; fi
35+
Original file line number Diff line number Diff line change 1919 <spring-oauth2 .version>2.5.0</spring-oauth2 .version>
2020 </properties >
2121
22+ <profiles >
23+ <profile >
24+ <id >HAL_EXPLORER</id >
25+ <dependencies >
26+ <dependency >
27+ <groupId >org.springframework.data</groupId >
28+ <artifactId >spring-data-rest-hal-explorer</artifactId >
29+ </dependency >
30+ </dependencies >
31+ </profile >
32+ </profiles >
33+
2234 <dependencies >
2335
2436 <dependency >
5163 <dependency >
5264 <groupId >org.springframework.data</groupId >
5365 <artifactId >spring-data-rest-hal-explorer</artifactId >
66+ <version >3.6.0</version >
67+ <type >pom</type >
5468 </dependency >
5569
5670 <dependency >
You can’t perform that action at this time.
0 commit comments