Docker multi-stage

Development

Build:

docker build . -t awesome-app --target development --no-cache

Run with docker compose:

docker compose up

Run with docker run:

docker run --env-file ./.env.development -p 3000:3000 awesome-app

Production

Build:

docker build . -t awesome-app --target development --no-cache

Run with docker compose:

docker compose -f ./docker-compose.prod.yml up

Run with docker run:

docker run --env-file ./.env -p 3000:3000 awesome-app