Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby example #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions Dockerfile

This file was deleted.

9 changes: 9 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ruby:2.7

WORKDIR /app
ADD Gemfile* ./
RUN bundle install

ADD . ./

CMD ["bundle","exec","puma"]
5 changes: 5 additions & 0 deletions backend/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'rack'
gem 'rack-unreloader' # for dynamic reloading
gem 'puma'
16 changes: 16 additions & 0 deletions backend/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
nio4r (2.5.9)
puma (5.6.7)
nio4r (~> 2.0)
rack (2.2.6.4)
rack-unreloader (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
puma
rack
rack-unreloader
5 changes: 5 additions & 0 deletions backend/app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class App
def self.call(env)
[ 200, {"Content-Type" => "text/html"}, ["Hello Uffizzi Dev 4"]]
end
end
7 changes: 7 additions & 0 deletions backend/config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require './app.rb'

require 'rack/unreloader'
Unreloader = Rack::Unreloader.new{App}

Unreloader.require './*.rb'
run Unreloader
33 changes: 33 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: Service
metadata:
name: ruby
spec:
ports:
- port: 9292
targetPort: 9292
type: LoadBalancer
selector:
app: ruby
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruby
spec:
selector:
matchLabels:
app: ruby
template:
metadata:
labels:
app: ruby
spec:
containers:
- name: ruby
image: ttl.sh/ruby-example
ports:
- containerPort: 9292
env:
- name: RACK_ENV
value: "development"
52 changes: 0 additions & 52 deletions manifests/web.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions package.json

This file was deleted.

11 changes: 0 additions & 11 deletions public/index.html

This file was deleted.

16 changes: 7 additions & 9 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
apiVersion: skaffold/v4beta2
apiVersion: skaffold/v4beta6
kind: Config
metadata:
name: ucluster-skaff-node-example
build:
local:
push: true
artifacts:
- image: ucluster-skaff-node-example
buildpacks:
builder: gcr.io/buildpacks/builder:v1
- image: ttl.sh/ruby-example
context: ./backend
sync:
infer:
- '*.rb'
manifests:
rawYaml:
- manifests/web.yaml
- 'k8s/*.yaml'
10 changes: 0 additions & 10 deletions src/index.js

This file was deleted.

Loading