Understood. In this case you must reach out to the internal IT security team in your company and ask them to whitelist the domain name+base url (eg: mythingworxserver/Thingworx/*) for the machine where you're executing those requests (that docker infrastructure).
You can ask them to whitelist "/Thingworx/Things/Machine_name/Properties/" but only if you're 100% sure that's the only request you'll ever make from that machine - up to you to decide.
The error you see can be caused by many things, I believe probably by the fact the VSCode inside that Docker is not able to reach out to the platform. That's 100% IT security job. ( It says timed out, but the issue is that for that endpoint you should have almost instant response back. 504 is gateway timeout error, which means that from proxy's perspective the TW server is not replying).
Note that once this issue is fixed, then maybe we can have a separate discussion on which API to choose to push data to InfluxDB (in this approach you'll loose data if the rate of accessing that endpoint is higher than the rate data is sent to ThingWorx).