将docker-compose.yml重写为mutagen-compose用法



我是Docker和Mutagen的新手,我不清楚如何正确描述存储。所以我请求你给我一些帮助。我正试图重写docker-compose.yml来处理诱变剂compose。这是原始的docker组成文件:

storefront:
build:
context: ./saleor-storefront
dockerfile: ./Dockerfile.dev
restart: unless-stopped
ports:
- 3000:3000
networks:
- saleor-backend-tier
depends_on:
- api
volumes:
- ./saleor-storefront/:/app:cached
- /app/node_modules/
# Nginx is used to proxy SSR requests thru docker networking
command: sh -c '(nginx &) && npm run start'

我尝试过的:

storefront:
build:
context: ./saleor-storefront
dockerfile: ./Dockerfile.dev
ports:
- 3000:3000
restart: unless-stopped
networks:
- saleor-backend-tier
depends_on:
- api
volumes:
- storefront:/app
- /app/node_modules/
# Nginx is used to proxy SSR requests thru docker networking
command: sh -c '(nginx &) && npm run start'
volumes:
saleor-db:
driver: local
saleor-redis:
driver: local
saleor-media:
storefront:
networks:
saleor-backend-tier:
driver: bridge
x-mutagen:
sync:
defaults:
ignore:
vcs: true
saleor-media:
alpha: "."
beta: "volume://saleor-media"
mode: "two-way-resolved"
saleor-storefront:
alpha: "./saleor-storefront"
beta: "volume://storefront/app"
mode: "two-way-resolved"

我从npm:saleor-platform-storefront-1 | npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'得到/app存储位置的错误。文件package.json本身就存在于项目的saleor店面目录中,我决定它应该位于/app目录的挂载卷中。我认为我在将现有Docker的位置映射到诱变剂组成方式的逻辑上犯了一些基本错误。谢谢你的帮助。

通过更改测试版获得:

x-mutagen:
sync:
defaults:
ignore:
vcs: true
saleor-media:
alpha: "."
beta: "volume://saleor-media"
mode: "two-way-resolved"
storefront:
alpha: "./saleor-storefront"
beta: "volume://storefront"
mode: "two-way-resolved"

相关内容

  • 没有找到相关文章

最新更新