Postgress init file cannot be found when run in codefresh

Hi
I have init.sql file in the same folder as docker-compose.yml, when it runs in Codefresh I get this error
[2024-01-30T15:57:58.457Z] postgres | psql:/docker-entrypoint-initdb.d/init.sql: error: could not read from input file: Is a directory

locally it runs fine. any suggestions how to fix in Codefresh?

how it is defined in docker compose:

  postgres:
    container_name: postgres
    image: postgres:latest
    environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: postgres
        POSTGRES_DB: postgres
        PGDATA: /data/postgres
    ports: 
        - 5432:5432
    volumes:
        **- ./init.sql:/docker-entrypoint-initdb.d/init.sql**

Hello and welcome to the Codefresh community :slight_smile:

Your volume line seems wrong to me. Are you sure you pasted it correctly?

Also you say “it runs in Codefresh” do you mean with a pipeline? Or a Codefresh composition?
Can you post a screenshot of the error message please?

thanks:)

there are no asterisks in .yml file, I tried to highlight that line here
it runs in the pipeline

I see

Please open a ticket with our support team and be sure to include the URL of the build above that has the integration tests step. They will then investigate

Kostis

1 Like