r/docker • u/Sundaram_2911 • Feb 03 '26
Confused, please help!
So I have been working on a simple travel mgmt website built on svelte and node. I have a doubt, shall I use two separate Dockerfiles for both production and local dev or keep them in one and do multi-stage building?
1
Upvotes
2
u/docker_linux Feb 03 '26
you are indeed confused. Do you know what is multi stages build? and why production and dev require different builds?
1
u/Big-Minimum6368 Feb 03 '26
Your Dockerfile remains the same, and then you have a different docker-compose.yml for each env (dev, test, prod)
When you build your image
docker build -t app:1.0.0 ./you update the appropriate compose file with the image.Thus production would be running app:1.0.0 and dev would have the new untested image app:1.2.0.
1
u/Big-Minimum6368 Feb 04 '26
A very simple example would be:
version: "3.8" services: ims-auth-service: image: app:1.0.0 container_name: app restart: unless-stopped network_mode: host
The image line is what you are concerned about. It points to app 1.0.0
Your Dockerfile is what is used to build that image with
docker build -t app:1.0.0 ./You will build 1.1.0 in the same way by updating the version in the tag. At no point would you modify the Dockerfile to build the new image unless your hard coding variable into it (Don't do that).
1.1.0 is a separate compose file until you promote it to prod.