Skip to content

Instantly share code, notes, and snippets.

@Panthro
Last active April 16, 2018 11:04
Show Gist options
  • Save Panthro/b5d34ce7d21687718d8a7ba7796ca3b6 to your computer and use it in GitHub Desktop.
Save Panthro/b5d34ce7d21687718d8a7ba7796ca3b6 to your computer and use it in GitHub Desktop.
Docker-compose for rancher with java8 and newrelic
eureka-newrelic-java-agent:
image: rkhtech/newrelic-java-agent
stdin_open: true
tty: true
command:
- exit
- '0'
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
eureka:
image: registry.gitlab.com/xxxxx/eureka:master
environment:
NEW_RELIC_APP_NAME: eureka
JAVA_OPTS: -javaagent:/newrelic/newrelic.jar
NEW_RELIC_LICENSE_KEY: xxxxxxxxx
stdin_open: true
tty: true
volumes_from:
- eureka-newrelic-java-agent
labels:
io.rancher.sidekicks: eureka-newrelic-java-agent
io.rancher.container.hostname_override: container_name
io.rancher.container.pull_image: always
FROM openjdk:8-alpine
VOLUME /tmp
RUN apk add --update curl && \
rm -rf /var/cache/apk/*
VOLUME /tmp
ENV SERVER_PORT=8761
EXPOSE 8761
ADD *.jar app.jar
RUN sh -c 'touch /app.jar'
ENV DEFAULT_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1"
ENV JAVA_OPTS=""
CMD [ "sh", "-c", "java $JAVA_OPTS $DEFAULT_OPTIONS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment