Deploying Flask and Celery with Rust
For our Flask application's Docker image to support our Rust packages, we need to make some changes to the src/Dockerfile file. Looking at this file, we can see that our image is built on python:3.6.13-stretch. This is essentially a Linux environment with Python installed. When we see this, we realize that we can be confident in manipulating our Docker image environment. If we can do this in Linux, there is a high chance we can do this in our Docker image. Considering this, what we must do in our src/Dockerfile file is install Rust and register cargo with the following code:
. . .
RUN apt-get update -y
RUN apt-get install -y python3-dev python-dev gcc
# setup rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y –profile
minimal –no-modify-path
# Add .cargo/bin to PATH
ENV PATH="/root/.cargo/bin:${PATH}"
. . .
Luckily for us, Rust is very easy to install. Remember that the apt-get install -y python3...