docker-compose相对路径编译

可以通过指定context来设置docker-compose的工作路径,../表示当前路径的父路径。

 

version: '3'

services:
  test:
    build: 
      context: ../
      dockerfile: apis/app/test/Dockerfile
    image: test
    container_name: test
    ports:
      - "8000:8000"
      - "9000:9000"
    network_mode: bridge
    volumes:
      - ./app/test/configs:/apis/app/test/configs

 

posted @ 2023-07-06 11:47  若-飞  阅读(177)  评论(0)    收藏  举报