Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
31 changes: 31 additions & 0 deletions serverside_challenge_2/challenge/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# flyctl launch added from .gitignore
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
.bundle

# Ignore all logfiles and tempfiles.
log\*
tmp\*
!log\.keep
!tmp\.keep

# Ignore pidfiles, but keep the directory.
tmp\pids\*
!tmp\pids
!tmp\pids\.keep

# Ignore uploaded files in development.
storage\*
!storage\.keep
tmp\storage\*
!tmp\storage
!tmp\storage\.keep

# Ignore master key for decrypting credentials and more.
config\master.key
fly.toml
71 changes: 65 additions & 6 deletions serverside_challenge_2/challenge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,67 @@
# ベースイメージ
FROM ruby:3.1.2
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs vim
RUN mkdir /app

# 必要パッケージ
RUN apt-get update -qq && apt-get install -y \
build-essential \
libpq-dev \
nodejs \
postgresql-client \
vim \
&& rm -rf /var/lib/apt/lists/*

# 作業ディレクトリ
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app

# Gemfile を先にコピーして bundle install(キャッシュ活用)
COPY Gemfile* ./
RUN bundle install --jobs 4 --retry 3

# アプリ全体コピー
COPY . .

# PID ファイル削除してサーバー起動
CMD ["sh", "-c", "rm -f tmp/pids/server.pid && RAILS_ENV=production bin/rails server -b 0.0.0.0 -p 8080"]



#FROM ruby:3.1.2
#RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs vim postgresql-client
#RUN mkdir /app
#WORKDIR /app
#ADD Gemfile /app/Gemfile
#ADD Gemfile.lock /app/Gemfile.lock
#RUN bundle install
#ADD . /app
## Gemfile
#COPY Gemfile* ./
#RUN bundle install
## アプリコードコピー
#COPY . .
## デフォルトコマンド(Fly.io が起動時に使用)
#CMD ["bin/rails", "server", "-b", "0.0.0.0", "-p", "8080"]


#FROM ruby:3.1.2
#RUN apt-get update -qq && apt-get install -y \
# build-essential \
# libpq-dev \
# nodejs \
# yarn \
# vim
#
## 作業ディレクトリ
#WORKDIR /app
## bundler を最新化(bundle not found 防止)
#RUN gem install bundler
## Gemfile を先にコピーして bundle install
#COPY Gemfile Gemfile.lock ./
#RUN bundle install
## アプリ全体をコピー
#COPY . .
## ポートを公開
#EXPOSE 3000
#ENV RAILS_ENV=production
#ENV RACK_ENV=production
## Rails サーバーを起動
#CMD ["bin/rails", "server", "-b", "0.0.0.0", "-p", "3000"]
2 changes: 2 additions & 0 deletions serverside_challenge_2/challenge/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ gem "bootsnap", require: false
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"

gem "rails-html-sanitizer"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
Expand Down
197 changes: 104 additions & 93 deletions serverside_challenge_2/challenge/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,170 +1,180 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
actioncable (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
actionmailbox (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
actionmailer (7.0.8.7)
actionpack (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
actionpack (7.0.8.7)
actionview (= 7.0.8.7)
activesupport (= 7.0.8.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
actiontext (7.0.8.7)
actionpack (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8)
activesupport (= 7.0.8)
actionview (7.0.8.7)
activesupport (= 7.0.8.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8)
activesupport (= 7.0.8)
activejob (7.0.8.7)
activesupport (= 7.0.8.7)
globalid (>= 0.3.6)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
activemodel (7.0.8.7)
activesupport (= 7.0.8.7)
activerecord (7.0.8.7)
activemodel (= 7.0.8.7)
activesupport (= 7.0.8.7)
activestorage (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activesupport (= 7.0.8.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8)
activesupport (7.0.8.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
bootsnap (1.18.3)
base64 (0.3.0)
bootsnap (1.18.6)
msgpack (~> 1.2)
builder (3.2.4)
concurrent-ruby (1.2.3)
builder (3.3.0)
cgi (0.5.0)
concurrent-ruby (1.3.5)
crass (1.0.6)
date (3.3.4)
debug (1.9.1)
date (3.4.1)
debug (1.11.0)
irb (~> 1.10)
reline (>= 0.3.8)
erubi (1.12.0)
globalid (1.2.1)
erb (4.0.4)
cgi (>= 0.3.3)
erubi (1.13.1)
globalid (1.3.0)
activesupport (>= 6.1)
i18n (1.14.1)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.11.2)
rdoc
io-console (0.8.1)
irb (1.15.2)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
loofah (2.22.0)
loofah (2.24.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
marcel (1.1.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.22.2)
msgpack (1.7.2)
net-imap (0.4.10)
mini_portile2 (2.8.9)
minitest (5.25.5)
msgpack (1.8.0)
net-imap (0.5.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0.1)
net-smtp (0.5.1)
net-protocol
nio4r (2.7.0)
nokogiri (1.16.2-aarch64-linux)
nio4r (2.7.4)
nokogiri (1.18.10)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
pg (1.5.4)
psych (5.1.2)
pg (1.6.2-x86_64-linux)
pp (0.6.2)
prettyprint
prettyprint (0.2.0)
psych (5.2.6)
date
stringio
puma (5.6.8)
puma (5.6.9)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8)
rack-test (2.1.0)
racc (1.8.1)
rack (2.2.17)
rack-test (2.2.0)
rack (>= 1.3)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
rails (7.0.8.7)
actioncable (= 7.0.8.7)
actionmailbox (= 7.0.8.7)
actionmailer (= 7.0.8.7)
actionpack (= 7.0.8.7)
actiontext (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activemodel (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
bundler (>= 1.15.0)
railties (= 7.0.8)
rails-dom-testing (2.2.0)
railties (= 7.0.8.7)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.1.0)
rdoc (6.6.2)
rake (13.3.0)
rdoc (6.14.2)
erb
psych (>= 4.0.0)
reline (0.4.2)
reline (0.6.2)
io-console (~> 0.5)
stringio (3.1.0)
thor (1.3.0)
timeout (0.4.1)
stringio (3.1.7)
thor (1.4.0)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.6)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.13)
zeitwerk (2.6.18)

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
Expand All @@ -173,6 +183,7 @@ DEPENDENCIES
pg (~> 1.1)
puma (~> 5.0)
rails (~> 7.0.8)
rails-html-sanitizer
tzinfo-data

RUBY VERSION
Expand Down
Loading