Docker compose is not starting all containers (possibly Flask related?) Docker compose is not starting all containers (possibly Flask related?) flask flask

Docker compose is not starting all containers (possibly Flask related?)


You have a RUN command that can not finish in your app dockerfile. This is preventing your dockerfile from ever finishing building. It's why it says step 8/8 and never says "successfully built" like your web container. I'd move that last run command into an entrypoint or CMD, like you have it in your web docker file, so that way the docker build command can actually finish.

IE CMD ["python", "src/main.py"] or ENTRYPOINT ["python", "src/main.py"]

That is most likely what is preventing your docker images from being built. Is because of that one last line in APP where you are starting a webserver in the foreground which never closes. Best bet is to place the command into entrypoint so it does not actually run during the build process, but will run when the image is started.

this is the line I'm talking about:

Step 8/8 : RUN python src/main.py ---> Running in e86c8adf46f0 * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)

VS this one out of the web build.

Step 10/10 : ENTRYPOINT npm start ---> Using cache ---> 9c5ec6770c47Successfully built 9c5ec6770c47Successfully tagged testcomposemachine_web:latestRecreating testcomposemachine_web_1Starting testcomposemachine_db_1Attaching to testcomposemachine_db_1, testcomposemachine_web_1

the build will never finish if the command never completes. So yes, in a way the Flask API is preventing your docker-compose command from building all the other files.