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