Skip to content

Commit

Permalink
Merge pull request 'v1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
wtde committed Sep 22, 2024
2 parents 6e98886 + 87e84be commit e019491
Show file tree
Hide file tree
Showing 140 changed files with 4,110 additions and 8,818 deletions.
7 changes: 5 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
RAILS_ENV=development
PORT=3080
POSTGRES_HOST="db"
POSTGRES_HOST="twilight_db"
POSTGRES_PORT=5432
POSTGRES_DB=twilight_development
POSTGRES_USER=postgres
POSTGRES_PASSWORD=pass
POSTGRES_PASSWORD=pass
REDIS_URL="redis://redis:6379/1"

HOST_URL="twilight.example.com" # Enter your URL, without http(s). Required for Docker.
2 changes: 1 addition & 1 deletion .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.3.2
- name: Install libvips
run: sudo apt-get install -y libvips
- name: Install gems
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
ruby-version: 3.3.2

- name: Rubocop run
run: |
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.vscode
.idea
.db-data
.devbox
.cache
/config/credentials.yml
/db/schema.rb
Expand Down Expand Up @@ -48,4 +49,10 @@ yarn-debug.log*
.yarn-integrity
config/database.yml
Gemfile.lock
.env
.env
gemset.nix
flake.lock
flake.nix
devbox.d
devbox.lock
dump.rdb
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.7.7
TargetRubyVersion: 3.3.2
Exclude:
- 'bin/*'
- 'config/**/*'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.7.7
ruby-3.3.2
40 changes: 24 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start from a small, trusted base image with the version pinned down
FROM ruby:2.7.7-slim AS base
FROM ruby:3.3.2-slim AS base

# Required Libraries
#RUN apt-get update; apt-get install -y --no-install-recommends \
Expand All @@ -15,55 +15,63 @@ 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 apt-get update; apt-get install -y --no-install-recommends \
libpng-dev libjpeg-dev libtiff-dev \
libpng-dev libjpeg-dev libtiff-dev ffmpeg \
tzdata libv8-dev imagemagick libmagickwand-dev \
libpq-dev libffi-dev \
postgresql-client sqlite3 \
#postgresql postgresql-contrib sqlite3 \
postgresql-client \
nodejs redis yarn

# This stage will be responsible for installing gems and npm packages
FROM base AS dependencies

COPY Gemfile Gemfile.lock ./
COPY Gemfile ./

# For EasyCaptcha install
#RUN git clone https://github.com/4point/easy_captcha /vendor/gems/easy_captcha
COPY ./vendor/gems/easy_captcha /vendor/gems/easy_captcha

# Install gems (excluding test dependencies)
RUN bundle config set without "test" && \
bundle install --jobs=3 --retry=3
RUN gem install bundler -v 2.5.9

RUN bundle install --jobs=3 --retry=3

COPY package.json yarn.lock ./

# NodeJS & yarn install
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
RUN . ~/.nvm/nvm.sh && nvm install node && \
yarn install --frozen-lockfile
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN . ~/.nvm/nvm.sh && nvm install 20.12.2 && nvm alias default 20.12.2 && \
yarn install

# We're back at the base stage
FROM base

# Create a non-root user to run the app and own app-specific files
RUN adduser app

# Switch to this user
USER app

# We'll install the app in this directory
WORKDIR /home/app

# Copy over gems from the dependencies stage
COPY --from=dependencies /usr/local/bundle/ /usr/local/bundle/

# Copy over npm packages from the dependencies stage
# Note that we have to use `--chown` here
COPY --chown=app --from=dependencies /node_modules/ node_modules/

COPY --from=dependencies /node_modules/ /root/app/node_modules/

# Finally, copy over the code
# This is where the .dockerignore file comes into play
# Note that we have to use `--chown` here
COPY --chown=app . ./
#RUN mkdir -p /root/app
COPY . /root/app/

# For EasyCaptcha install
COPY --from=dependencies /vendor/gems/ /root/app/vendor/gems/

WORKDIR /root/app

# Install assets
# RUN cd /home/app && bundle exec rake webpacker:compile && bundle exec rake assets:precompile
RUN cd /root/app && bundle exec rake webpacker:compile && bundle exec rake assets:precompile

# Listen port
EXPOSE ${PORT}
Expand Down
46 changes: 28 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.7'
ruby '3.3.2'

gem 'activerecord', '>= 6.1.7.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.4.2'
gem 'rails', '~> 7.0.8.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '>= 1.4'
#gem 'sqlite3', '>= 1.4'
# Use Puma as the app server
gem 'puma', '>= 5.6.4'
gem 'puma', '>= 6.4.2'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacke
gem 'webpacker', '>= 5.4.2'
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem 'importmap-rails'
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem 'turbo-rails'
gem 'turbo-rails', '~> 2.0.5'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '>= 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand All @@ -35,6 +35,17 @@ gem 'actionpack', '>= 6.1.4.1'
# Reduces boot times through caching; required in config/boot.b
gem 'bootsnap', '>= 1.4.4', require: false

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'listen'
gem 'rack-mini-profiler'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
Expand All @@ -43,17 +54,7 @@ group :development, :test do
gem 'rspec'
gem 'rspec-rails'
gem 'rubocop-rspec', require: false
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'listen', '~> 3.3'
gem 'rack-mini-profiler', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'rubocop-performance'
end

group :test do
Expand All @@ -79,34 +80,43 @@ gem 'rubocop-rails'
gem 'action_policy'
gem 'active_storage_validations'
gem 'addressable', '>= 2.8.0'
gem "ahoy_matey"
gem 'betterlorem'
gem 'closure_tree', '>= 7.4.0'
gem 'devise'
gem 'dry-initializer-rails'
gem 'easy_captcha', github: 'kopylovvlad/easy_captcha'
gem 'easy_captcha', path: 'vendor/gems/easy_captcha'
gem 'enumerize'
gem 'friendly_id', '~> 5.5.1'
gem 'grape'
gem 'image_processing', '>= 1.12.2'
gem 'mini_magick'
gem 'nokogiri', '>= 1.11.0.rc4'
gem 'open-uri'
gem 'paper_trail', '>= 15.1.0'
gem 'pg'
gem 'rake', '>= 13.2.1'
gem 'redcarpet'
gem 'reverse_markdown'
gem 'rmagick', '~> 4.1.1'
gem 'rmagick'
gem 'rollbar'
gem 'rubyzip'
gem 'ruby-vips'
gem 'simple_command'
gem 'socksify', require: false # TCP through a SOCKS5 proxy
gem 'telegram-bot'

gem 'sidekiq'
gem 'base64'
gem 'mutex_m'

gem 'bootstrap-sass'
gem 'bootstrap-will_paginate', '~> 0.0.10'
gem 'font-awesome-rails'
gem 'font-awesome-sass', '~> 5.15.1'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'meta-tags'
gem 'rails_sortable'
gem 'therubyracer', platforms: :ruby
gem 'will_paginate', '~> 3.3.1'
Expand Down
Loading

0 comments on commit e019491

Please sign in to comment.