adding required config

This commit is contained in:
dhirsch1 2023-08-15 11:38:00 +03:00
parent 0a529015bc
commit 4bdc4df9dd
3 changed files with 35 additions and 0 deletions

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM openjdk:17.0.1-slim
WORKDIR /opt
ENV PORT 8080
ENV POSTGRES_USER petclinic
ENV POSTGRES_PASSWORD petclinic
ENV POSTGRES_URL jdbc:postgresql://postgres/petclinic
ENV JAVA_OPTS "-Dspring.profiles.active=postgres -Xmx2g"
EXPOSE 8080
COPY target/*.jar /opt/app.jar
COPY --from=contrast/agent-java:latest /contrast/contrast-agent.jar /opt/contrast/contrast.jar
COPY config/contrast_security.yaml /opt/contrast/contrast_security.yaml
ENV JAVA_TOOL_OPTIONS "-javaagent:/opt/contrast/contrast.jar -Dcontrast.config.path=/opt/contrast/contrast_security.yaml"
ENTRYPOINT exec java ${JAVA_OPTS} -jar app.jar

View file

@ -0,0 +1,6 @@
agent:
java:
scan_all_classes: false
scan_all_code_sources: false
logger:
stdout: true

View file

@ -25,3 +25,19 @@ services:
- POSTGRES_DB=petclinic
profiles:
- postgres
petclinic:
# image: spring-petclinic:3.1.0-SNAPSHOT
image: mypetclinic
ports:
- "8080:8080"
environment:
- CONTRAST__API__API_KEY=${CONTRAST__API__API_KEY}
- CONTRAST__API__SERVICE_KEY=${CONTRAST__API__SERVICE_KEY}
- CONTRAST__API__USER_NAME=${CONTRAST__API__USER_NAME}
- CONTRAST__API__URL=https://intuit.contrastsecurity.com/Contrast
depends_on:
- mysql
- postgres
profiles:
- mysql
- postgres