Sign inSign up

rdcool/ruby

By rdcool

•Updated over 2 years ago

Image
0

857

rdcool/ruby repository overview

#1 Use an official Ruby runtime as a parent image FROM ruby:3.1.2

⁠Set the working directory in the container

WORKDIR /usr/src/app

⁠Copy the Gemfile and Gemfile.lock into the working directory

COPY Gemfile Gemfile.lock ./

⁠Install any needed packages specified in the Gemfile

RUN bundle install

RUN gem install bundler

⁠Copy the rest of the application code into the working directory

COPY . .

⁠Make port 4567 available to the world outside this container

EXPOSE 4567

⁠Define the command to run the application

CMD ["ruby", "app.rb"] source "https://rubygems.org⁠"

gem "sinatra" gem "rackup" source "https://rubygems.org⁠"

gem "sinatra" require 'sinatra'

get '/' do 'Hello, world!' end

#2

⁠Use an official Ruby runtime as a parent image

FROM ruby:3.1.2

⁠Set the working directory in the container

WORKDIR /usr/src/app

⁠Copy the Gemfile and Gemfile.lock into the working directory

COPY Gemfile Gemfile.lock ./

⁠Install any needed packages specified in the Gemfile

RUN bundle install

RUN gem install bundler

⁠Copy the rest of the application code into the working directory

COPY . .

⁠Make port 4567 available to the world outside this container

EXPOSE 3000

⁠Define the command to run the application

CMD ["ruby", "app.rb"] source "https://rubygems.org⁠"

gem "sinatra" gem "rackup" source "https://rubygems.org⁠"

gem "sinatra" require 'sinatra'

get '/' do 'Hello, world!' end

Tag summary

Content type

Image

Digest

sha256:17c1b1376…

Size

346.4 MB

Last updated

over 2 years ago

docker pull rdcool/ruby