Skip to content

Commit

Permalink
fix for issue #487
Browse files Browse the repository at this point in the history
  • Loading branch information
ktarbet authored and MikeNeilson committed Jan 5, 2024
1 parent 95735d0 commit dd35a35
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RUN gradle clean prepareDockerBuild --info --no-daemon
FROM alpine:3.19.0 as tomcat_base
RUN apk update && apk upgrade --no-cache
RUN apk add openjdk8-jre curl
RUN apk add --no-cache bash


RUN mkdir /download && \
cd /download && \
Expand Down
10 changes: 10 additions & 0 deletions compose_files/pki/certs/installcerts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# install certs for use in docker dev environment
CERT_DIR="/etc/ssl/certs/java/cacerts"

if keytool -list -keystore ${CERT_DIR} -alias cda_lab_root -storepass changeit > /dev/null; then
echo "Alias exists, deleting..."
keytool -delete -alias cda_lab_root -keystore ${CERT_DIR} -storepass changeit
fi
echo "Importing certificate..."
keytool -trustcacerts -importcert -alias cda_lab_root -keystore ${CERT_DIR} -storepass changeit -file /conf/rootca.pem -noprompt
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:
target: api
context: .
dockerfile: Dockerfile
command: bash -c "keytool -trustcacerts -importcert -alias cda_lab_root -keystore /opt/java/openjdk/jre/lib/security/cacerts -storepass changeit -file /conf/rootca.pem -noprompt || catalina.sh run"
command: bash -c "/conf/installcerts.sh && /usr/local/tomcat/bin/catalina.sh run"
restart: unless-stopped
volumes:
- ./compose_files/pki/certs:/conf/
Expand Down Expand Up @@ -162,4 +162,4 @@ services:
- "traefik.http.routers.api.rule=Host(`traefik.test`)"
- "traefik.http.routers.api.entryPoints=traefik"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.tls=true"
- "traefik.http.routers.api.tls=true"

0 comments on commit dd35a35

Please sign in to comment.