cp .env.example .env
- Edit
.env
variable forPORT
andIMAGE_VERSION
docker-compose build
docker-compose up
docker-compose up -d
docker-compose down
docker-compose down -v
docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
docker-compose push
- What base image do I start with?
- What environment variables does my project need?
- What do I need to separate from development and production environments?
- How am I starting the application in development vs production?
- Don't use third party images for production applications.
- Don't build sensitive files into your images.
- Use COPY over ADD to prevent command injection possibilities.
- Production images should be lean and have only what's needed to run your application.
- Create your docker-compose commands as npm scripts so you don't have to type them repeatedly. (But know what they do)