因此,我目前可以使用仅运行数据库和测试脚本的“ docker-compose up test”。我想让我们说“ docker-compose up app”或类似的东西可以运行除测试之外的所有方法。这样我就不会运行不必要的容器。我不确定是否有办法,但这就是我想知道的。某些链接已经执行了一些操作,我可以找出其余的链接。基本上,我只能使用一个命令运行某些容器,而不运行其他命令。
Yaml
version: '3'
services:
webapp:
build: ./literate-app
command: nodemon -e vue,js,css start.js
depends_on:
- postgres
links:
- postgres
environment:
- DB_HOST=postgres
ports:
- "3000:3000"
networks:
- literate-net
server:
build: ./readability-server
command: nodemon -L --inspect=0.0.0.0:5555 server.js
networks:
- literate-net
redis_db:
image: redis:alpine
networks:
- literate-net
postgres:
restart: 'always'
#image: 'bitnami/postgresql:latest'
volumes:
- /bitnami
ports:
- "5432:5432"
networks:
- literate-net
environment:
- "FILLA_DB_USER=my_user"
- "FILLA_DB_PASSWORD=password123"
- "FILLA_DB_DATABASE=my_database"
- "POSTGRES_PASSWORD=password123"
build: './database-creation'
test:
image: node:latest
build: …Run Code Online (Sandbox Code Playgroud)