One Dockerfile for Production and Development
![One Dockerfile for Production and Development One Dockerfile for Production and Development](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6caeda0e-02e8-4a0c-8de6-a45f353a18c8_1698x584.png)
Too many intro to Docker tutorials create multiple Dockerfiles for each environment, or only go over creating one environment. Here's a quick and easy way to keep a single file and overwrite the command in development.
Let's look at an example Dockerfile for building a react app and copying it over to nginx:
FROM node:latest
COPY package.json package.jso…
Keep reading with a 7-day free trial
Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.