Setting Up The Ruby On Rails With Docker Container

preview_player
Показать описание
Setting Up The Ruby On Rails With Docker Container
Please fine the commands below.

#railsdocker #dockercontainersetup

Docker, Ruby on rails set up

and past the following code.(lets do that)

Dockerfile:(copy past below code in your docker file)

FROM ruby:2.5.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /testing_docker
RUN gem install bundler -v 2.0.2
WORKDIR /testing_docker
ENV BUNDLER_VERSION 2.0.2
ADD Gemfile /testing_docker/Gemfile
RUN bundle install
ADD . /testing_docker
_______________________________________________________________________

version: '2'(version of the app)
services:
db:
image: postgres:11.4-alpine
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/testing_docker
ports:
- "3000:3000"
depends_on:
- db

now its time to build docker container
using below commands
_________________________________________________________________________

terminal commands:

1) docker-compose build

2) docker-compose up
Рекомендации по теме
join shbcf.ru