- Gemfile
- app.rb
- config.ru
- docker-composer.yml
source 'https://rubygems.org'
gem 'sinatra'
require 'sinatra'
get '/' do
'Hello world!'
end
require './app'
run Sinatra::Application
version: "3.7"
services:
# sinatra_app
# ----------------------------------------------------------------------
sinatra_app:
image: 'ruby:2.7.0'
ports: [ '3000:3000' ]
volumes: [ '.:/app', 'bundle-cache:/usr/local/bundle' ]
working_dir: '/app'
# use this to "ssh" in to box with: docker-compose run --rm --service-ports sinatra_app
# command: /bin/bash
# use this to run the server
command: bash -c 'bundle install && bundle exec rackup -p 3000 --host 0.0.0.0'
# ----------------------------------------------------------------------
volumes:
bundle-cache: