mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:35:49 +00:00
adding required config
This commit is contained in:
parent
0a529015bc
commit
4bdc4df9dd
3 changed files with 35 additions and 0 deletions
13
Dockerfile
Normal file
13
Dockerfile
Normal 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
|
6
config/contrast_security.yaml
Normal file
6
config/contrast_security.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
agent:
|
||||||
|
java:
|
||||||
|
scan_all_classes: false
|
||||||
|
scan_all_code_sources: false
|
||||||
|
logger:
|
||||||
|
stdout: true
|
|
@ -25,3 +25,19 @@ services:
|
||||||
- POSTGRES_DB=petclinic
|
- POSTGRES_DB=petclinic
|
||||||
profiles:
|
profiles:
|
||||||
- postgres
|
- 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
|
||||||
|
|
Loading…
Reference in a new issue