version: '3' services: postcat: # build: 从当前路径构建镜像 build: context: . dockerfile: Dockerfile target: production image: eolinker/postcat:${VERSION} container_name: postcat restart: always extra_hosts: - 'host.docker.internal:host-gateway' ports: - '8000:80' networks: - postcat_net postcat-test-server: # build: 从当前路径构建镜像 build: context: . dockerfile: Dockerfile target: builder image: eolinker/postcat-test-server:${VERSION} container_name: postcat-test-server restart: always extra_hosts: - 'host.docker.internal:host-gateway' ports: - '4201:4201' - '4202:4202' networks: - postcat_net networks: postcat_net: name: postcat_net