-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
25 lines (19 loc) · 1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM clojure:lein-2.10.0 AS builder
MAINTAINER Kiba Gateaux the_anonymous_hash+masterdjinn@proton.me
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get -y update; apt-get -y install curl;
RUN curl -o honeycomb.jar -L https://github.com/honeycombio/honeycomb-opentelemetry-java/releases/latest/download/honeycomb-opentelemetry-javaagent.jar
RUN lein uberjar
FROM clojure:lein-2.10.0
# if prod deployment
EXPOSE 80
# if dev deployment
EXPOSE 8888
# RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app.jar
ARG JAR_FILE="/usr/src/app/target/master-djinn-0.0.1-SNAPSHOT-standalone.jar"
WORKDIR /usr/src/app
COPY --from=builder $JAR_FILE ./app.jar
COPY --from=builder /usr/src/app/honeycomb.jar ./honeycomb.jar
# https://stackoverflow.com/questions/57885828/netty-cannot-access-class-jdk-internal-misc-unsafe
CMD ["java", "-javaagent:honeycomb.jar", "--add-opens", "java.base/jdk.internal.misc=ALL-UNNAMED", "--illegal-access=permit", "-Dio.netty.tryReflectionSetAccessible=true", "-jar", "./app.jar"]