The container currently runs code as a root user which provides possibility to break the running instance of the container, at least until the Python server process is restarted. Let's create a non-root user in the Docker image and use that to run code. Perhaps something like this:
ENV USERNAME=fortran
RUN useradd \
--no-log-init \
--home-dir /home/$USERNAME \
--create-home \
--shell /bin/bash \
$USERNAME
USER $USERNAME
WORKDIR /home/$USERNAME