TarteelAI / quranic-universal-library

A comprehensive collection of Quran resources
https://qul.tarteel.ai/
MIT License
227 stars 20 forks source link

Create a docker-compose file to simplify dev environment setup #139

Open piraka9011 opened 1 month ago

piraka9011 commented 1 month ago

Right now developers have to install and setup postgres locally on their machines as well as modify the database.yml file in order to get setup correctly. The local postgres installation may also conflict with other apps using the local postgres db.

Create a new docker-compose.yml file that sets up the DB properly and also update the database.yml file to reflect any changes made to the docker-compose.yml. Update the README with instructions on how to setup docker and run the compose file before running the rails app.

Sample Compose file:

services:
  db:
    image: postgres:14
    # To improve the performance of postgres, you can add the following flags
    # -c maintenance_work_mem=1GB -c effective_cache_size=12GB -c work_mem=1GB -c shared_buffers=4GB -c wal_buffers=16MB
    command: >
      postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=off
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    env_file:
      - .env
    ports:
      - "5432:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data

volumes:
  postgres-data:
JP-sDEV commented 1 month ago

Hi can I be assigned this issue?

piraka9011 commented 1 month ago

@JP-sDEV Sure just open up a PR and tag this issue and we'll review.