- add: Dockerfile for building docker containers

This commit is contained in:
2024-12-14 04:13:34 -05:00
parent 697231965b
commit e179b3b995
5 changed files with 84 additions and 0 deletions

24
auth-service/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Use Rust official image for building the application
FROM rust:1.83 as builder
LABEL authors="raven"
# Set the working directory
WORKDIR /usr/src/auth-service
# Copy the project files
COPY . .
# Build the application in release mode
RUN cargo build --release
# Use a minimal base image to run the application
FROM debian:bullseye-slim
# Copy the compiled binary
COPY --from=builder /usr/src/auth-service/target/release/auth-service /usr/local/bin/auth-service
# Expose the service port
EXPOSE 50051
# Set the entrypoint for the container
CMD ["auth-service"]