4

我正在尝试使用 docker cloud/docker hub 设置自动构建。当我有 docker-compose.yml 时,它总是在寻找 Dockerfile。我找不到任何改变这一点的选项。我想知道这是不可能的还是我错过了什么?

这是我的 docker-compose.yml

version: '3'
services:
  reverse-proxy:
    image: traefik
    ports:
      - "80:80"
      - "443:443"
      - "${TRAEFIK_DASHBOARD_PORT}:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik/traefik.toml:/etc/traefik/traefik.toml
      - ./traefik/certs/journal.crt:/certs/journal.crt
      - ./traefik/certs/journal.key:/certs/journal.key
    networks:
      - web
  prisma:
    image: prismagraphql/prisma:1.8
    restart: always
    ports:
      - "${PRISMA_PORT}"
    networks:
      - web
    environment:
      PRISMA_CONFIG: |
        port: ${PRISMA_PORT}
        managementApiSecret: ${PRISMA_MANAGEMENT_API_SECRET}
        databases:
          default:
            connector: postgres
            host: ${PRISMA_DB_HOST}
            port: ${PRISMA_DB_PORT}
            database: ${PRISMA_DB}
            user: ${PRISMA_DB_USER}
            password: ${PRISMA_DB_PASSWORD}
            migrations: ${PRISMA_ENABLE_MIGRATION}
  graphql-server:
    build:
      context: ./graphql-server/
      args:
        - PORT=${GRAPHQL_SERVER_PORT}
    networks:
      - web
    ports:
      - "${GRAPHQL_SERVER_PORT}"
    volumes:
      - ./graphql-server:/usr/src/app
    depends_on:
      - prisma
    command: ["./wait-for-it.sh", "prisma:${PRISMA_PORT}", "--", "./bootstrap.sh"]
    environment:
      - PRISMA_SERVICE_NAME=prisma
      - PRISMA_PORT
      - GRAPHQL_SERVER_PORT
      - APOLLO_ENGINE_KEY
      - PRISMA_ENDPOINT
      - PRISMA_MANAGEMENT_API_SECRET
    labels:
      - "traefik.backend=graphql"
      - "traefik.frontend.rule=Host:api.journal.com"
      - "traefik.enable=true"
      - "traefik.port=8080"
      - "traefik.docker.network=web"
  react-client:
    build:
      context: ./react-client/
      args:
        - PORT=${REACT_CLIENT_PORT}
    ports:
      - "${REACT_CLIENT_PORT}"
    volumes:
      - ./react-client:/usr/src/app
    depends_on:
      - graphql-server
    environment:
      - GRAPHQL_SERVER_PORT
      - REACT_CLIENT_PORT
    networks:
      - web
networks:
  web:
    external: true

docker hub 和 docker cloud 都试图只获取 dockerfile 而不是 docker-compose。我还看到一篇文章提到 docker-compose 应该只用于运行而不是构建;所以我不确定我是否做错了什么。

4

0 回答 0