Skip to content

This repo is about process of containerizing and executing Ruby code within a container environment. Tech Stack --> [docker, ruby-gem, docker-compose, ci-cd, webrick, ruby]

License

Notifications You must be signed in to change notification settings

vishalbidwe/ruby-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Containerizing and Running a Ruby Application

This repo walks you through containerizing and running a Ruby application.

To start, open a terminal window and navigate to a directory on your computer where you want to store the sample application. Then, run the following command to clone the repository:

$ git clone https://github.com/vishalbidwe/ruby-docker.git

You should now have the following files in your ruby-docker directory.

├── ruby-docker/
│ ├── server.rb
│ ├── Gemfile
│ ├── Gemfile.lock
│ ├── compose.yaml
│ ├── Dockerfile
│ └── README.md

Run the application

Inside the ruby-docker directory, run the following command in a terminal.

$ docker compose up --build

Open a browser and paste http://localhost:443 in URL bar. You should see a simple Ruby application which displays current day in calender.

In the terminal, press ctrl+c to stop the application.

Run the application in the background

You can run the application detached from the terminal i.e it will run in background by adding the -d option flag. Inside the ruby-docker directory, run the following command in a terminal.

$ docker compose up --build -d

Open a browser and view the application at http://localhost:443.

You should see a simple ruby application.

In the terminal, run the following command to stop the application.

$ docker compose down

About

This repo is about process of containerizing and executing Ruby code within a container environment. Tech Stack --> [docker, ruby-gem, docker-compose, ci-cd, webrick, ruby]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published