Build the docker container after cloning/downloading the repo
docker-compose build webAlso we might be constantly adding new gems. So, it will be good if you ran the above command each time you pull.
To ensure dependencies are up-to-date periodically run the following two commands:
docker-compose run web bundle install
docker-compose run web yarn installThe above two sections will ensure that the container is up-to-date.
To create the development and test databases first start up the database container:
docker-compose up --detach dbThen verify that the container is running:
docker-compose psThe output should look something like this:
Name Command State Ports
-------------------------------------------------------------------
hackoverflow_db_1 docker-entrypoint.sh postgres Up 5432/tcpRun the following to create the database:
docker-compose run web rails db:createStart up the containers:
docker-compose upThen verify that the containers are running:
docker-compose psThe app should be running at http://localhost:3000
Now, the schemas for Databases are constantly changing. So, run this command to get the latest ones.
docker-compose run web rails db:migrateRun these commands to ensure you are up-to-date with our dev environments
docker-compose build web
docker-compose run web bundle install
docker-compose run web yarn install
docker-compose run web rails db:migrateThen start the container and check the website at http://localhost:3000