Open Closed

All kinds of wrong in Docker-compose.yml file #5262


User avatar
0
Sturla created

I´m just reporting an issue that I have (see step 3) worked around and expect to get refunded.

Issue The Docker-compose.yml file is not created correctly and doesn´t work out of the box for a solution created with Suite like this

If you create a new solution with suite as above image you will

1 get this error in the docker-compose.yml file.

Incorrect type. Expected "array | docker-compose.yml" in docker-compose.yml

The depends_on: is missing - postgres

2 I picked Postgres but the docker-compose.yml contains sql-server but should be "postgres"

3 This is what I ended up creating. I´m no docker expert and got the help from my GPT friend. It would be great if this would just work out of the box!

version: '3.8'

services:
  searchportal-blazor:
    image: lf/searchportal-blazor:latest
    container_name: searchportal-blazor
    build:
      context: ../../
      dockerfile: src/LF.SearchPortal.Blazor/Dockerfile.local
    environment:
      - ASPNETCORE_URLS=https://+:443;http://+:80;
      - Kestrel__Certificates__Default__Path=/root/certificate/localhost.pfx
      - Kestrel__Certificates__Default__Password=91f91912-5ab0-49df-8166-23377efaf3cc
      - App__SelfUrl=https://localhost:44314
      - AuthServer__RequireHttpsMetadata=false      
      - AuthServer__Authority=http://searchportal-blazor
      - ConnectionStrings__Default=Host=postgres;Database=SearchPortal;Username=postgres;Password=myPassw0rd;
    ports:
      - "44314:443"
    restart: on-failure
    volumes:
      - ./certs:/root/certificate
    networks:
      - abp-network
    depends_on:
      - postgres

  db-migrator:
    image: lf/searchportal-db-migrator:latest
    container_name: db-migrator
    build:
      context: ../../
      dockerfile: src/SearchPortal.DbMigrator/Dockerfile.local
    environment:
      - OpenIddict__Applications__SearchPortal_BlazorServerTiered__RootUrl=https://localhost:44314
      - ConnectionStrings__Default=Host=postgres;Database=SearchPortal;Username=postgres;Password=myPassw0rd;
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - abp-network
  
  postgres:
    image: postgres:latest
    container_name: postgres
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: "postgres"
      POSTGRES_PASSWORD: "myPassw0rd"
      POSTGRES_DB: "SearchPortal"
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - abp-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 10s
      retries: 5
  
  # Added a UI to be able to view the database
  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: "pgadmin4@pgadmin.org"
      PGADMIN_DEFAULT_PASSWORD: "admin"
    ports:
      - "5050:80"
    volumes:
      - pgadmin-data:/var/lib/pgadmin
    networks:
      - abp-network
    depends_on:
      - postgres
    healthcheck:
      test: ["CMD-SHELL", "wget","-O","-","http://localhost:80/misc/ping"]
      interval: 10s
      timeout: 10s
      retries: 5

volumes:
  pgdata:
    name: searchportal_pgdata
  pgadmin-data:
    name: pgadmin-data

networks:
  abp-network:
    name: searchportal-network
    driver: bridge
  • ABP Framework version: v7.2.2

  • UI type: Blazor Server

  • DB provider: EF Core / Postgress

  • Tiered (MVC) or Identity Server Separated (Angular): no

  • Exception message and stack trace: Severity Code Description Project File Line Suppression State Error (active) 0 Incorrect type. Expected "array | docker-compose.yml C:...aspnet-core\etc\docker\docker-compose.yml 20

  • Steps to reproduce the issue:"


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We will fix it, thanks for your report.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Hello,

    We only support Sql-Server and MongoDb on docker environment. Generating different docker-compose files based on different dbms is on the backlog. I will update documentation related to this issue.

    Your ticket has been refunded.

    Thank you.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38