DEV Community

Discussion on: A Rails and PostgreSQL setup for GitHub actions (CI)

Collapse
 
vvo profile image
Vincent Voyer

Thanks for that! I just removed that part. I tried to use it though and ran into issues mostly because my setup is not fully docker-compose based. I use docker-compose only for services, my Rails code runs in the ubuntu container from GitHub.

So the issue I get is this one:

initialize': Permission denied @ dir_initialize - /home/runner/work/project/project/postgres-data (Errno::EACCES)

My docker-compose.yml:

version: "3.7"
services:
  db:
    image: postgres:11.6-alpine
    ports:
      - "54320:5432"
    environment:
      POSTGRES_PASSWORD: turnshift
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

The volume is mounted with a user/permission that is different from the one used when I run the rails test command. I tried to work around that without luck, if you have any idea let me know. From what I can tell I think your whole infra runs in a docker container while me I always run Ruby/Rails locally and only use compose for services (good or bad that's how I do it for now).

Thanks again!