I have recently started learning API. I did all my projects on Ubuntu VM. I used flask for API and mongoDB to store my users input, all this in Docker. When I moved my code from VM to Windows, and installed Docker desktop I have been facing this issue of "not responding" / "The server at 172.20.0.3 is taking too long to respond."
vs code terminal output:
This is my file structure:
docker-compose.yml code:
version: '3'
services:
web:
build: './web'
ports:
- '5000:5000'
links:
- db
db:
build: './db'
web/Dockerfile:
FROM python:3
WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m spacy download en_core_web_sm
COPY . .
CMD ["python","app.py"]
db/Dockerfile:
FROM mongo:3.6.4
To check the code for app.py please use my GitHub link. This issue is not just for this app, it is same for my other projects which I developed in Ubuntu Virtual machine.