Dockerfile 954 Bytes
Newer Older
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 26 27
FROM java:openjdk-8-jdk as builder

ENV GRADLE_VERSION 3.4.1

WORKDIR /usr/bin
RUN curl -sLO https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip && \
  unzip gradle-${GRADLE_VERSION}-all.zip > /dev/null && \
  ln -s gradle-${GRADLE_VERSION} gradle && \
  rm gradle-${GRADLE_VERSION}-all.zip

ENV GRADLE_HOME /usr/bin/gradle
ENV PATH $PATH:$GRADLE_HOME/bin

COPY ./build.gradle /services/build.gradle
COPY ./settings.gradle /services/settings.gradle

WORKDIR /services

RUN gradle dependencies

COPY ./src /services/src
COPY ./config /services/config

RUN gradle --no-daemon -x test build oneJar



28
FROM java:8
29

30
COPY --from=builder /services/build/libs/services-1.0-SNAPSHOT-standalone.jar /services-1.0-SNAPSHOT-standalone.jar
31

32 33 34
ADD entrypoint.sh /entrypoint.sh

CMD /entrypoint.sh \
35
    -Done-jar.silent=true \
36
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5070 \
37
    -jar /services-1.0-SNAPSHOT-standalone.jar