Skip to content

Commit

Permalink
Adding Dockerfile for production usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed Dec 17, 2024
1 parent 26fd307 commit 35418f2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use the official Rust image as the base image
FROM rust:latest AS builder

# Set the working directory
WORKDIR /usr/src/app

# Copy the Cargo.toml and Cargo.lock files
COPY Cargo.toml Cargo.lock ./

# Copy the source code
COPY . .

# Build the application
RUN cargo build --release

# Use a minimal base image for the final stage
FROM debian:buster-slim

# Set the working directory
WORKDIR /usr/src/app

# Copy the built binary from the builder stage
COPY --from=builder /usr/src/app/target/release/x_bot .

# Expose the port the app runs on
EXPOSE 7878

# Run the application
CMD ["./x_bot"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ code, are actively maintaining it (including documentation), or in other ways
being awesome contributors to this project. **We'd like to take a moment to recognize them.**

[<img src="https://github.com/mjovanc.png?size=72" alt="mjovanc" width="72">](https://github.com/mjovanc)
[<img src="https://github.com/dmbtechdev.png?size=72" alt="dmbtechdev" width="72">](https://github.com/dmbtechdev)

## License

Expand Down

0 comments on commit 35418f2

Please sign in to comment.