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:
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 thedatabase.yml
file to reflect any changes made to thedocker-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: