I'm wondering how I can make a basic http requests inside a docker container:
https_example.py
import requests
x = requests.get('https://w3schools.com')
print(x.status_code)
Dockerfile
FROM python:3.8-slim-buster
WORKDIR /
COPY requirements.txt .
COPY https_example.py .
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "https_example.py"]
My requirements file just has requests
If I run this locally I don't get a response in the logs.