/social_network

Small social network app built with Ruby/Ruby on Rails

Primary LanguageRuby

Social network app

Description

Social network app built with Ruby and Ruby on Rails.
App consists of 2 Docker containers: 1 - rails app, 2 - postgres database.
The volume binding is used in development to map container files and folders to host machine.
Volume binding makes it possible to exclude files from mapping.
There are separate Docker and Docker compose files for development and test environments.

Tech stack

  • Docker
  • Docker compose
  • Ruby
  • Ruby on Rails
  • Postgres
  • Minitest - for tests

How to make it work

For development environment:
cd to project root folder.
We have 2 containers in development environment.
Create images + create and run containers:
docker-compose -f ./docker-compose-dev.yml up
Stop and remove containers:
docker-compose -f ./docker-compose-dev.yml down
Rebuild images + create and run containers:
docker-compose -f ./docker-compose-dev.yml up --build
List services:
docker-compose -f ./docker-compose-dev.yml ps
App runs on localhost:3000

For test environment:
cd to project root folder.
We have 2 containers in test environment.
Create images + create and run containers:
docker-compose -f ./docker-compose-test.yml up
Stop and remove containers:
docker-compose -f ./docker-compose-test.yml down
Rebuild images + create and run containers:
docker-compose -f ./docker-compose-test.yml up --build
List services:
docker-compose -f ./docker-compose-test.yml ps
Container where tests are run may need to restart few times
in order to connect to postgres.
Don't forget to stop all the services after running tests.