Skip to content

Commit

Permalink
Merge pull request #252 from datafruits/update-dockerfile
Browse files Browse the repository at this point in the history
ruby 3.2.2, remove node stuff from Dockerfile
  • Loading branch information
mcfiredrill authored May 21, 2023
2 parents f7129d9 + 692b743 commit c394c49
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 674 deletions.
27 changes: 5 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,31 @@ FROM ubuntu:latest
# ENV LANG en_US.UTF-8

ENV DEBIAN_FRONTEND noninteractive
ARG DOCKER_GROUP_ID

RUN apt update
RUN apt upgrade -y
RUN apt-get install -y build-essential libtag1-dev libffi-dev \
xvfb firefox git curl sox libsox-fmt-mp3 libpq-dev imagemagick sudo postgresql-client

# for ruby
RUN apt-get install -y --force-yes libssl-dev libreadline-dev zlib1g-dev
RUN apt-get install -y --force-yes autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev

# yarn
RUN sudo apt-get install apt-transport-https
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN sudo apt-get update && sudo apt-get install -y yarn

RUN apt-get clean
# RUN apt-get clean

# add user
RUN groupadd -g 1000 rails && useradd --create-home -s /bin/bash -u 1000 -g 1000 rails ;\
adduser rails sudo
RUN echo "Defaults !requiretty" >> /etc/sudoers
RUN echo "%sudo ALL=NOPASSWD: ALL" >> /etc/sudoers
RUN groupadd -g 999 docker
RUN groupadd -g $DOCKER_GROUP_ID docker
RUN gpasswd -a rails docker

USER rails
ENV HOME /home/rails
# Install rbenv and ruby-build
ENV RUBY_VERSION 3.1.2
ENV RUBY_VERSION 3.2.2
RUN git clone https://github.com/rbenv/rbenv.git /home/rails/.rbenv
RUN git clone https://github.com/rbenv/ruby-build.git /home/rails/.rbenv/plugins/ruby-build
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> /home/rails/.bashrc
Expand All @@ -50,19 +46,6 @@ RUN rbenv exec gem install bundler
RUN rbenv rehash
RUN rbenv exec bundle config --global github.https true

# node
ENV NODE_VERSION 6.17.0

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default

ENV NVM_DIR /home/rails/.nvm
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH
# Configure the main working directory. This is the base
# # directory used in any further RUN, COPY, and ENTRYPOINT
# # commands.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ gem 'aws-sdk'
gem 'paperclip'

gem 'rupeepeethree', github: "datafruits/rupeepeethree"
gem "so_id3", github: "streampusher/so_id3"
gem "so_id3", github: "streampusher/so_id3", branch: "rp3-bump"

gem 'whenever', require: false

Expand Down
49 changes: 25 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
GIT
remote: https://github.com/datafruits/rupeepeethree.git
revision: 576361e9cb22326a0bc2715b1dc7556658905a84
revision: 632725c66257203bb6254a87953b45fb142cacc3
specs:
rupeepeethree (0.0.6)
rupeepeethree (0.0.7)
mime-types (>= 1.16)
optimist
taglib-ruby (~> 0.7.0)
taglib-ruby (~> 1.1)

GIT
remote: https://github.com/streampusher/ruby-liquidsoap.git
Expand All @@ -15,13 +15,14 @@ GIT

GIT
remote: https://github.com/streampusher/so_id3.git
revision: d96d4e7660890496429c0deb8ff354eb1f832f0e
revision: bdaa2530bc60d2c22497e5d625433484dfda1f32
branch: rp3-bump
specs:
so_id3 (0.0.1)
activejob
activerecord
aws-sdk-s3 (~> 1)
rupeepeethree (~> 0.0.6)
rupeepeethree (~> 0.0.7)

GIT
remote: https://github.com/waiting-for-dev/warden-jwt_auth.git
Expand Down Expand Up @@ -108,7 +109,7 @@ GEM
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.646.0)
aws-partitions (1.765.0)
aws-sdk (3.1.0)
aws-sdk-resources (~> 3)
aws-sdk-accessanalyzer (1.30.0)
Expand Down Expand Up @@ -351,10 +352,10 @@ GEM
aws-sdk-controltower (1.0.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.160.0)
aws-sdk-core (3.172.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-costandusagereportservice (1.41.0)
aws-sdk-core (~> 3, >= 3.127.0)
Expand Down Expand Up @@ -638,8 +639,8 @@ GEM
aws-sdk-kinesisvideosignalingchannels (1.19.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-kms (1.58.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (1.64.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-lakeformation (1.27.0)
aws-sdk-core (~> 3, >= 3.127.0)
Expand Down Expand Up @@ -1223,8 +1224,8 @@ GEM
aws-sdk-route53resolver (1.37.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-s3 (1.122.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sdk-s3control (1.52.0)
Expand Down Expand Up @@ -1439,7 +1440,7 @@ GEM
chronic (0.10.2)
climate_control (0.2.0)
coderay (1.1.3)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
connection_pool (2.3.0)
crack (0.4.5)
rexml
Expand Down Expand Up @@ -1480,7 +1481,7 @@ GEM
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
excon (0.94.0)
excon (0.99.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
Expand All @@ -1493,7 +1494,7 @@ GEM
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
geocoder (1.8.1)
globalid (1.0.1)
globalid (1.1.0)
activesupport (>= 5.0)
groupdate (6.1.0)
activesupport (>= 5.2)
Expand All @@ -1503,9 +1504,9 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.12.0)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
jmespath (1.6.1)
jmespath (1.6.2)
json (2.6.2)
jsonapi-renderer (0.2.2)
jsonapi-serializer (2.2.0)
Expand Down Expand Up @@ -1542,13 +1543,13 @@ GEM
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mime-types-data (3.2023.0218.1)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.17.0)
minitest (5.18.0)
mock_redis (0.34.0)
ruby2_keywords
multi_json (1.15.0)
Expand Down Expand Up @@ -1707,7 +1708,7 @@ GEM
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
syslog_protocol (0.9.2)
taglib-ruby (0.7.1)
taglib-ruby (1.1.3)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (1.2.1)
Expand All @@ -1716,7 +1717,7 @@ GEM
tilt (2.0.11)
timecop (0.9.5)
timeout (0.3.1)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.5)
tzinfo (>= 1.0.0)
Expand All @@ -1740,7 +1741,7 @@ GEM
chronic (>= 0.6.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.6)
zeitwerk (2.6.8)

PLATFORMS
ruby
Expand Down Expand Up @@ -1812,4 +1813,4 @@ DEPENDENCIES
whenever

BUNDLED WITH
2.2.30
2.4.13
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ run app with docker-compose
```
$ ./script/app
```

You may have to build the streampusher/streampusher container to get the correct
docker group ID from your host machine.

```
docker build \
--build-arg DOCKER_GROUP_ID=`getent group docker | \
cut -d: -f3` -t streampusher/streampusher:latest .
```
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Application < Rails::Application
env_file = File.join(Rails.root, 'config', 'application.yml')
YAML.load(File.open(env_file))[Rails.env].each do |key, value|
ENV[key.to_s] = value
end if File.exists?(env_file)
end if File.exist?(env_file)
end

config.middleware.use ActionDispatch::Cookies
Expand Down
10 changes: 5 additions & 5 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: "3"
services:
icecast:
image: "mcfiredrill/icecast:latest"
ports:
- "8000:8000"
restart: "always"
# icecast:
# image: "mcfiredrill/icecast:latest"
# ports:
# - "8000:8000"
# restart: "always"
redis:
image: "redis:latest"
ports:
Expand Down
Loading

0 comments on commit c394c49

Please sign in to comment.