Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Latest commit

 

History

History
87 lines (68 loc) · 1.78 KB

File metadata and controls

87 lines (68 loc) · 1.78 KB

Project Setup Instructions

All commands are in rerunConatiner.sh

1. Install Dependencies

Run this after updating the Gemfile:

docker run --rm -v "$PWD":/app -w /app ruby:3.2.2 bundle install

NOTE for Apple silicon users:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

2. Build and Run Containers

Build the Web Container

docker-compose build web

Start the Database Container

docker-compose up --detach db

OPTIONAL: Verify the container is up:

docker-compose ps

3. Setup the Database

Create the Database

docker-compose run web rails db:create

Create the Schema File

docker-compose run web rails db:migrate

The schema file can be found at db/schema.rb if you want to commit it.

4. Start the Development Server

docker-compose up

Access the application using http://localhost:3000.


Possible Changes

If you encounter permission issues with the database container, you may need to update the volumes section in docker-compose.yml. Change:

volumes:
  - ./tmp/db:/var/lib/postgresql/data

To:

volumes:
  - db-data:/var/lib/postgresql/data

This avoids permission issues and aligns with standard practices. Consider whether using tmp has specific purposes before making the change.


Additional Commands

If you encounter issues during migrations, try the following commands:

  1. Reset the database and rerun migrations:

    docker-compose run web rails db:migrate:reset
  2. If that doesn’t work, drop and recreate the database:

    docker-compose run web rails db:drop
    docker-compose run web rails db:create
  3. Then rerun migrations:

    docker-compose run web rails db:migrate