我想构建自定义的Dockerfile,但是我遇到了这个错误信息:
--> 开始构建应用程序
ERROR: The Compose file is invalid because:
Service app has neither an image nor a build context specified. At least one must be provided.
我不理解为什么名称是 app
。你可以看看我的docker-compose.yml文件:
version: "3"
services:
webapp-react:
build:
context: ./docker/nodejs
dockerfile: Dockerfile
image: webapp/react
container_name: webapp_react
user: ${UID}:${GID}
environment:
- NODE_ENV=build
webapp-nginx:
build:
context: ./docker/nginx
dockerfile: Dockerfile
image: webapp/nginx
container_name: webapp_nginx
environment:
- VIRTUAL_HOST=${SITE_URL}
- VIRTUAL_PORT=8080
- VIRTUAL_NETWORK=nginx-proxy
- LETSENCRYPT_HOST=${SITE_URL}
- LETSENCRYPT_EMAIL=${MAILER_DEFAUT_SENDER_ADDRESS}
ports:
- "8181:80"
volumes:
- ./app/build:/www-data/
networks:
default:
external:
name: nginx-proxy
有人知道我哪里出错了吗?
谢谢!