From 1c87d91d4e3653702ca2c00420941829bf03709c Mon Sep 17 00:00:00 2001 From: Tom Trevethan Date: Fri, 2 Aug 2024 14:59:02 +0100 Subject: [PATCH] Revert "Update Dockerfile (#81)" (#83) This reverts commit e37b62725f8c54b20be36383791a147035f6e5c9. --- Rocket2.toml | 3 --- token-server/Dockerfile | 40 ++++++++++------------------------------ 2 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 Rocket2.toml diff --git a/Rocket2.toml b/Rocket2.toml deleted file mode 100644 index 732f51f6..00000000 --- a/Rocket2.toml +++ /dev/null @@ -1,3 +0,0 @@ -[global] -address = "0.0.0.0" -port = 8001 diff --git a/token-server/Dockerfile b/token-server/Dockerfile index 80f940d9..e62903cd 100644 --- a/token-server/Dockerfile +++ b/token-server/Dockerfile @@ -1,34 +1,14 @@ -# Use a base image that has the required GLIBC version -FROM debian:bullseye-slim as builder +FROM rust:1.77.0 -# Install Rust, protobuf compiler, and library dependencies -RUN apt-get update && apt-get install -y curl build-essential protobuf-compiler libprotobuf-dev pkg-config libssl-dev -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# Set working directory +WORKDIR /app/lib +COPY ../lib . -# Set the environment path for Rust -ENV PATH="/root/.cargo/bin:${PATH}" +# Copy the project code +WORKDIR /app +COPY . . -# Create a working directory -WORKDIR /mercurylayer - -RUN echo "[workspace]\nmembers = [\"token-server\", \"lib\"]" > ./Cargo.toml -COPY ./Cargo.lock ./Cargo.lock - -# Copy the server source code -COPY ./token-server ./token-server -COPY ./lib ./lib -COPY ./Rocket2.toml ./token-server/Rocket.toml - -# Make sure to copy Cargo.lock -COPY ./token-server/Cargo.lock ./token-server/Cargo.lock - -WORKDIR /mercurylayer/token-server - -# RUN cargo build --verbose - -# # Build your Rust project. Since the source files are now present, -# # the Rust compiler should be able to find and compile them. -RUN CARGO_TARGET_DIR=target cargo build --release - -# # Command to run the server by default when the container starts +RUN cargo build --release +EXPOSE 8001 +# Run the application CMD ["cargo", "run", "--bin", "token-server"]