# Use the official Rust image as a base
FROM rust:1.80.1

# Install the rust-optimizer (you can modify this if you're using a specific optimizer or tool)
RUN cargo install rust-optimizer

# Create a new directory for your code
WORKDIR /code

# Copy your project files to the container
COPY . .

# Build the project using rust-optimizer
RUN rust-optimizer

# If you want to run tests, you can add:
# RUN cargo test

# Set the entrypoint to the optimizer if you plan to use the container for optimization
ENTRYPOINT ["rust-optimizer"]

# Optional: you can also specify a command to run after building
CMD ["build"]