On Running a docker container, It is exiting automatically

git repo : https://github.com/samAd0san/two-tier-flask-app.git

I have used the Dockerfile to build an image, then proceeded by running a flask app container.

docker run -d -p 5000:5000 --network=twotier 
           -e MYSQL_HOST=mysql 
           -e MYSQL_USER=admin 
           -e MYSQL_PASSWORD=admin 
           -e MYSQL_DB=myDb 
           --name=flaskapp flaskapp:latest

The problem occurs when I launch this command:

docker ps -a
2860157851d9   
flaskapp:latest   
"python app.py"

      5 minutes ago   Exited (1) 5 minutes ago

flaskapp

The container should run on executing the command so that I can deploy the flask app on the container and it is connected with mysql container.

Ultimately I'm not able to access the application.



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation