Docker-compose: replace “build”-based service with pre-built image in production?
问题 Let's say we have the following docker-compose.yml : version: '3' services: db: image: "postgres" ports: - "5432:5432" environment: - POSTGRES_PASSWORD=mysecretpassword web: build: web depends_on: [ db ] ports: - "80:80" The first service, db , just runs a container with the official postgres image from Docker Hub. The second service, web , first builds a new image based on the Dockerfile in a folder also called web , then runs a container with that image. While developing, we now can