Skip to content

Commit

Permalink
Merge pull request #151 from djdefi/remove-sinatra
Browse files Browse the repository at this point in the history
Remove Sinatra dependency
  • Loading branch information
djdefi committed May 16, 2024
2 parents ab1fee5 + dae10f6 commit bbe768b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml → .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Hadolint Action
uses: brpaz/[email protected]
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM ruby:3-alpine

# Install python for simple HTTP server
RUN apk add --no-cache python3

VOLUME /usr/src/app/public
CMD ["./render.rb"]
WORKDIR /usr/src/app

COPY . .
RUN bundle install --jobs 4

# Run the render script then serve the public/index.html using a simple HTTP server
CMD ["sh", "-c", "bundle exec ruby render.rb && python3 -m http.server 8000 --directory public"]
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ source 'https://rubygems.org'
gem 'httparty'
gem 'rss'

group :standalone do
gem 'sinatra', '~> 4.0'
end

group :development do
gem 'minitest'
end
end
18 changes: 0 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
GEM
remote: https://rubygems.org/
specs:
base64 (0.2.0)
csv (3.3.0)
httparty (0.22.0)
csv
Expand All @@ -10,25 +9,9 @@ GEM
mini_mime (1.1.5)
minitest (5.23.0)
multi_xml (0.6.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
rack (3.0.9.1)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rexml (3.2.6)
rss (0.3.0)
rexml
ruby2_keywords (0.0.5)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
tilt (2.3.0)

PLATFORMS
ruby
Expand All @@ -37,7 +20,6 @@ DEPENDENCIES
httparty
minitest
rss
sinatra (~> 4.0)

BUNDLED WITH
2.3.18
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ This will verify that the output of `render.rb` matches the expected HTML struct

### Docker

Served up on port 8080 with nginx:
To run the application using Docker, build the Docker image and then run the container:

```
docker build -t djdefi/rss-firehose .
docker run --rm -v rss-firehose:/usr/src/app/public -it djdefi/rss-firehose
docker run --name rss-nginx --rm -v rss-firehose:/usr/share/nginx/html:ro -p 8080:80 nginx:1.14.0-alpine
```

Re-run the `rss-firehose` container to update the page.
Expand Down
8 changes: 0 additions & 8 deletions server.rb

This file was deleted.

0 comments on commit bbe768b

Please sign in to comment.