- add: Dockerfile for building docker containers
This commit is contained in:
15
api-service/Dockerfile
Normal file
15
api-service/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM rust:1.83 as builder
|
||||
LABEL authors="raven"
|
||||
|
||||
WORKDIR /usr/src/api-service
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
COPY --from=builder /usr/src/api-service/target/release/api-service /usr/local/bin/api-service
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["api-service"]
|
||||
24
auth-service/Dockerfile
Normal file
24
auth-service/Dockerfile
Normal 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"]
|
||||
15
database-service/Dockerfile
Normal file
15
database-service/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM rust:1.83 as builder
|
||||
LABEL authors="raven"
|
||||
|
||||
WORKDIR /usr/src/database-service
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
COPY --from=builder /usr/src/database-service/target/release/api-service /usr/local/bin/database-service
|
||||
|
||||
EXPOSE 50052
|
||||
|
||||
CMD ["database-service"]
|
||||
15
packet-service/Dockerfile
Normal file
15
packet-service/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM rust:1.83 as builder
|
||||
LABEL authors="raven"
|
||||
|
||||
WORKDIR /usr/src/packet-service
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
COPY --from=builder /usr/src/packet-service/target/release/api-service /usr/local/bin/packet-service
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
CMD ["packet-service"]
|
||||
15
world-service/Dockerfile
Normal file
15
world-service/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM rust:1.83 as builder
|
||||
LABEL authors="raven"
|
||||
|
||||
WORKDIR /usr/src/world-service
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
COPY --from=builder /usr/src/database-service/target/release/world-service /usr/local/bin/world-service
|
||||
|
||||
EXPOSE 50054
|
||||
|
||||
CMD ["world-service"]
|
||||
Reference in New Issue
Block a user