DEV Community

Cover image for The Super Flash Docker Command
Everton Tenorio
Everton Tenorio

Posted on

The Super Flash Docker Command

Sometimes, I invoke the super flash docker like this:

docker run -dt --rm --entrypoint ./app/run.sh --name same-name -v $(pwd):/app -p 8080:8080 node:20-alpine
Enter fullscreen mode Exit fullscreen mode

The run.sh could be something like:

#!/bin/sh

cd /app
npm i ...
etc ...
npm run serve -- --host 0.0.0.0
Enter fullscreen mode Exit fullscreen mode

Less need for building, useful for real-time testing of the app being developed, on-demand. Additionally, if something goes wrong, the --rm flag will remove the container when stopped, and with --entrypoint ./app/run.sh, I customize how the container runs without relying on the original entry point of the image. Nothing against Dockerfile.

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay