From 58185122d1f7a4389fc073c3f2dec7f3ba906a0c Mon Sep 17 00:00:00 2001 From: albert-dm Date: Wed, 11 Sep 2024 21:57:00 -0300 Subject: [PATCH] fix: services docker --- Dockerfile => Dockerfile.api | 0 Dockerfile.listener | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) rename Dockerfile => Dockerfile.api (100%) create mode 100644 Dockerfile.listener diff --git a/Dockerfile b/Dockerfile.api similarity index 100% rename from Dockerfile rename to Dockerfile.api diff --git a/Dockerfile.listener b/Dockerfile.listener new file mode 100644 index 0000000..ef1738f --- /dev/null +++ b/Dockerfile.listener @@ -0,0 +1,24 @@ +FROM rust:1.75-alpine3.19 as builder + + +# Feature apenas em nightly +RUN rustup update nightly + +RUN rustup default nightly + +# Definindo a pasta dentro do container onde +WORKDIR /usr/src/tech-challenge + +# Install necessary packages for building Rust applications and OpenSSL development headers +RUN apk add musl-dev openssl-dev + +COPY . . + +RUN cargo build --release --bin listener + +# Criando um novo stage com imagem scratch e passando apenas os +# arquivos necessarios +FROM scratch as production +COPY --from=builder /usr/src/tech-challenge/target/release / +ENTRYPOINT [ "/listener" ] +EXPOSE 3000 \ No newline at end of file