I got an issue I'm able to launch flask container but when I go in my browser I got " This site is inaccessible", my api is not loaded
docker-compose :
version: "3"
services:
api:
container_name: api
build: ./api
environment:
- FLASK_APP=main.py
command: flask run
ports:
- "5000:5000"
Dockerfile :
FROM python:3
# Install and setup flask
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
EXPOSE 5000
UPDATE
basic app
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Result of docker-compose up --build
When I go to localhost:5000 I got "This site is inaccessible"
I don't have access to my app in my browser but why ? I exposed port 5000 in dockerfile and map port 5000:5000
Thank's in advance