Skip to content

andrii-rieznik/rails-api

Repository files navigation

Rails-API Build

This project fully placed in Docker.

There are two ways to setup environment and run application via Docker:

  1. Visual Studio Code Remote - open project in VS Code.

  2. Build manually from shell on any machine with docker.

📌 Requirements

🔧 Setup

  1. Install remote-containers Visual Studio Code extensions:

    > code --install-extension ms-vscode-remote.remote-containers
  2. Clone this repo to your machine:

    > git clone git@github.com:andrejreznik/rails-api.git
  3. Open Visual Studio Code in rails-api folder:

    > cd rails-api
    > code .

    or build manually (skip if using VS Code).

    > cd rails-api
    > docker-compose build .
  4. Prepare database:

    > bin/rails db:create

🚀 Run application

  1. To start rails server you need to start process in terminal:

    > bin/rails s -b 0

    or simply launch application by click on Run -> Run Without Debugging Ctrl + F5,

    or via docker-compose command:

    > docker-compose exec web bin/rails s -b 0

✔️ Run the test suite

  1. Run all specs:

    > rspec

🤖 Check for Rubocop offenses

  1. Check all files by RuboCop:

    > rubocop

⚖️ License

See LICENSE.