Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
Fixed Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed May 27, 2020
1 parent 028a671 commit b1a9007
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 38 deletions.
28 changes: 20 additions & 8 deletions as2-peppol-server/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
#

FROM maven:3.6-jdk-8-alpine
WORKDIR /as2-peppol-server
COPY pom.xml /as2-peppol-server/pom.xml
COPY src /as2-peppol-server/src
WORKDIR /as2-peppol

# Parent POM
COPY pom.xml /as2-peppol/pom.xml

# Server POM
COPY as2-peppol-server/pom.xml /as2-peppol/server/pom.xml
COPY as2-peppol-server/src /as2-peppol/server/src
VOLUME [ "/var/www/peppol-as2/receive", "/var/www/peppol-as2/send", "/var/www/peppol-as2/data" ]
EXPOSE 8080

Expand All @@ -35,7 +40,7 @@ RUN apk add openssh
# - aliasname must match to the certificate CN (Common Name)
# - key store password shall be 'peppol'
# - keystore filename shall be 'test-client-certs.p12' to work with "as2-peppol-client"
WORKDIR /as2-peppol-server/src/main/resources/keystore
WORKDIR /as2-peppol/server/src/main/resources/keystore
RUN openssl req \
-new \
-newkey rsa:2048 \
Expand All @@ -47,14 +52,21 @@ RUN openssl x509 -signkey my-private.key -in my-certificate.csr -req -days 365 -
RUN openssl pkcs12 -export -in my-certificate.cer -inkey my-private.key \
-out ap.pilot.p12 -passout pass:peppol -name ap.pilot

# building step
WORKDIR /as2-peppol-server

# NOTE: in maven Docker image default Maven repository location is configured as a volume
# NOTE: in Maven Docker image default Maven repository location is configured as a volume
# so anything copied there in a Dockerfile at build time is lost in /root/.m2/repository
# To preserve the project dependencies in the image we use special Maven settings
# for details see https://hub.docker.com/_/maven/
RUN mvn -B -s /usr/share/maven/ref/settings-docker.xml package -DskipTests=true

# building step 1
WORKDIR /as2-peppol
# Use "-N" to avoid submodules are build
RUN mvn -B -s /usr/share/maven/ref/settings-docker.xml install -DskipTests=true -N

# building step 2
WORKDIR /as2-peppol/server
# Use "-U" for SNAPSHOTs
RUN mvn -B -s /usr/share/maven/ref/settings-docker.xml package -DskipTests=true -U

RUN mvn jetty:deploy-war

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ This approach is useful if you need just run the reference implementation agains

The prebuild Dockerfile builds the WAR and runs it in Jetty.

Build like this: `docker --pull build -t as2-peppol-server .`
Build like this: `docker build --pull -t as2-peppol-server .`

Run like this: `docker run -d --name as2-peppol-server -p 8888:8080 as2-peppol-server`

Expand Down
14 changes: 0 additions & 14 deletions as2-peppol-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@
<distribution>repo</distribution>
</license>
</licenses>

<organization>
<name>Philip Helger</name>
<url>http://www.helger.com</url>
</organization>

<developers>
<developer>
<id>philip</id>
<name>Philip Helger</name>
<email>ph(at)helger.com</email>
<url>http://www.helger.com</url>
</developer>
</developers>

<dependencies>
<dependency>
Expand Down
16 changes: 1 addition & 15 deletions as2-peppol-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@
<distribution>repo</distribution>
</license>
</licenses>

<organization>
<name>Philip Helger</name>
<url>http://www.helger.com</url>
</organization>

<developers>
<developer>
<id>philip</id>
<name>Philip Helger</name>
<email>ph(at)helger.com</email>
<url>http://www.helger.com</url>
</developer>
</developers>

<properties>
<m2e.jaxrs.activation>false</m2e.jaxrs.activation>
Expand All @@ -60,7 +46,7 @@
<!-- Don't forget to update the Dockerfile when changing something here -->
<jetty.version>9.4.29.v20200521</jetty.version>
</properties>

<dependencies>
<dependency>
<groupId>com.helger</groupId>
Expand Down

0 comments on commit b1a9007

Please sign in to comment.