diff --git a/Dockerfile b/Dockerfile index df24c9eb..6d7d95d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-buster +FROM golang:1.13-buster AS buildcontainer ARG SIGNAL_CLI_VERSION=0.6.8 ARG SWAG_VERSION=1.6.7 @@ -29,10 +29,7 @@ RUN cd /tmp/ \ && git checkout v${SIGNAL_CLI_VERSION} \ && ./gradlew build \ && ./gradlew installDist \ - && ln -s /tmp/signal-cli-${SIGNAL_CLI_VERSION}/build/install/signal-cli/bin/signal-cli /usr/bin/signal-cli - -RUN mkdir -p /signal-cli-config/ -RUN mkdir -p /home/.local/share/signal-cli + && ln -s /tmp/signal-cli-${SIGNAL_CLI_VERSION}/build/install/signal-cli/ /tmp/signal-cli COPY src/api /tmp/signal-cli-rest-api-src/api COPY src/main.go /tmp/signal-cli-rest-api-src/ @@ -41,7 +38,15 @@ COPY src/go.sum /tmp/signal-cli-rest-api-src/ RUN cd /tmp/signal-cli-rest-api-src && swag init && go build -ENV PATH /tmp/signal-cli-rest-api-src/:/usr/bin/signal-cli-${SIGNAL_CLI_VERSION}/bin/:$PATH +# Start a fresh container for release container +FROM adoptopenjdk:11-jre-hotspot + +COPY --from=buildcontainer /tmp/signal-cli-rest-api-src/signal-cli-rest-api /usr/bin/signal-cli-rest-api +COPY --from=buildcontainer /tmp/signal-cli /opt/signal-cli + +RUN ln -s /opt/signal-cli/bin/signal-cli /usr/bin/signal-cli +RUN mkdir -p /signal-cli-config/ +RUN mkdir -p /home/.local/share/signal-cli EXPOSE 8080