-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
# Use the official Rust image as the base image | ||
FROM rust:latest | ||
FROM rust:1.75 | ||
|
||
# Set the working directory | ||
WORKDIR . | ||
WORKDIR /app | ||
|
||
# Copy the Cargo.toml files | ||
COPY Cargo.toml config.toml ./ | ||
|
||
# Copy the source code | ||
COPY src ./src | ||
|
||
# Accept a build argument for the build mode | ||
ARG BUILD_MODE=release | ||
|
||
# Build the application based on the build mode | ||
RUN if [ "$BUILD_MODE" = "debug" ]; then \ | ||
cargo build; \ | ||
else \ | ||
cargo build --release; \ | ||
fi | ||
|
||
# Expose the port your application uses | ||
EXPOSE 8080 | ||
|
||
# Set the unbuffered environment variable | ||
ENV RUST_BACKTRACE "1" | ||
|
||
# Run the binary conditionally based on the build mode | ||
CMD if [ "$BUILD_MODE" = "debug" ]; then ./target/debug/starknetid_server; else ./target/release/starknetid_server; fi |