To give visability to the error messages mount a volume to your container so after it crashes the logs are available ... problem otherwise is once crashed the logs go away ... for example this docker-compose.yaml excerpt is how to mount a volume
nodejs-enduser:
image: your-image-name
restart: always
volumes:
- /pathA:/pathB
pathA is full path to some logging dir on host where container is launched from
pathB is path processes write to from inside container
If you wrap your docker launch using something like supervisord then its config defines where standard out / stderr are written to ... that is /pathB ... then the app inside the container just writes to stdout / stderr
Alternative approach is to spin up an empty container then once running you log into it using docker exec -ti container-id bash
Once inside you then manually issue your Dockerfile commands to install and execute the app ( nodejs ) where you can then see the errors as they happen ... here is the Dockerfile for this do nothing container
FROM ubuntu:16.04
ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y wget curl net-tools
# COPY .bashrc /root/
# list your normal Dockerfile code COPY steps here
CMD ["/bin/bash"]
now build above Dockerfile
docker build --tag stens_ubuntu .
and run
docker run -d stens_ubuntu sleep infinity
now log into it
docker exec -it $( docker ps | grep stens_ubuntu | cut -d' ' -f1 ) bash
here you are at the command prompt inside the running container where you now issue whichever commands you need to run your normal app as listed in your original Dockerfile ... beauty is now you are interactively seeing the error happen ... until it crashes however the messages will be shown