This might be a start:
Your let-binding is probably not what you want. It just binds two variables to nil: tlsAvailable and gnutls-available-p.
I expect you really wanted this, which binds variable tlsAvailable to the result of calling nullary function gnutls-available-p.
(let ((tlsAvailable (gnutls-available-p)))
scad-mode is available on MELPA, not MELPA stable. You'll therefore need to set up regular MELPA instead of MELPA stable to install it. You might find this opinion piece about MELPA stable useful: https://old.reddit.com/r/emacs/comments/etikbz/speaking_as_a_package_maintainer_please_do_not/
Marmalade is unmaintained at this point. Despite repeated prodding ...
This is something of a workaround but if you create a docker image and install emacs on it and then connect it to melpa/elpa and then approve the connections to the package repositories, it will create a file network.data in root/.emacs.d/.
If you copy the text of that file and create a file named network.data and incorporate that into your docker build ...
I don't have complete answer, but few points which you have to take into consideration:
It won't be possible to connect to Melpa.org over port 80, so it is better to switch to https (port 443)
I don't have any debian to verify/falsify this guess, but most likely you are missing TLS library and certificates.
Ad1. As you can see below, any query to http ...