Skip to content

Commit cdbe552

Browse files
committed
Initial commit
0 parents  commit cdbe552

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1081
-0
lines changed

Diff for: .dockerignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2+
3+
# Ignore git directory.
4+
/.git/
5+
6+
# Ignore bundler config.
7+
/.bundle
8+
9+
# Ignore all environment files (except templates).
10+
/.env*
11+
!/.env*.erb
12+
13+
# Ignore all default key files.
14+
/config/master.key
15+
/config/credentials/*.key
16+
17+
# Ignore all logfiles and tempfiles.
18+
/log/*
19+
/tmp/*
20+
!/log/.keep
21+
!/tmp/.keep
22+
23+
# Ignore pidfiles, but keep the directory.
24+
/tmp/pids/*
25+
!/tmp/pids/.keep
26+
27+
# Ignore storage (uploaded files in development and any SQLite databases).
28+
/storage/*
29+
!/storage/.keep
30+
/tmp/storage/*
31+
!/tmp/storage/.keep

Diff for: .gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2+
3+
# Mark the database schema as having been generated.
4+
db/schema.rb linguist-generated
5+
6+
# Mark any vendored files as having been vendored.
7+
vendor/* linguist-vendored
8+
config/credentials/*.yml.enc diff=rails_credentials
9+
config/credentials.yml.enc diff=rails_credentials

Diff for: .gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all environment files (except templates).
11+
/.env*
12+
!/.env*.erb
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*
16+
/tmp/*
17+
!/log/.keep
18+
!/tmp/.keep
19+
20+
# Ignore pidfiles, but keep the directory.
21+
/tmp/pids/*
22+
!/tmp/pids/
23+
!/tmp/pids/.keep
24+
25+
# Ignore storage (uploaded files in development and any SQLite databases).
26+
/storage/*
27+
!/storage/.keep
28+
/tmp/storage/*
29+
!/tmp/storage/
30+
!/tmp/storage/.keep
31+
32+
# Ignore master key for decrypting credentials and more.
33+
/config/master.key

Diff for: .ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.2

Diff for: Dockerfile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4+
ARG RUBY_VERSION=3.2.2
5+
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6+
7+
# Rails app lives here
8+
WORKDIR /rails
9+
10+
# Set production environment
11+
ENV RAILS_ENV="production" \
12+
BUNDLE_DEPLOYMENT="1" \
13+
BUNDLE_PATH="/usr/local/bundle" \
14+
BUNDLE_WITHOUT="development"
15+
16+
17+
# Throw-away build stage to reduce size of final image
18+
FROM base as build
19+
20+
# Install packages needed to build gems
21+
RUN apt-get update -qq && \
22+
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config
23+
24+
# Install application gems
25+
COPY Gemfile Gemfile.lock ./
26+
RUN bundle install && \
27+
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
28+
bundle exec bootsnap precompile --gemfile
29+
30+
# Copy application code
31+
COPY . .
32+
33+
# Precompile bootsnap code for faster boot times
34+
RUN bundle exec bootsnap precompile app/ lib/
35+
36+
37+
# Final stage for app image
38+
FROM base
39+
40+
# Install packages needed for deployment
41+
RUN apt-get update -qq && \
42+
apt-get install --no-install-recommends -y curl libvips postgresql-client && \
43+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
44+
45+
# Copy built artifacts: gems, application
46+
COPY --from=build /usr/local/bundle /usr/local/bundle
47+
COPY --from=build /rails /rails
48+
49+
# Run and own only the runtime files as a non-root user for security
50+
RUN useradd rails --create-home --shell /bin/bash && \
51+
chown -R rails:rails db log storage tmp
52+
USER rails:rails
53+
54+
# Entrypoint prepares the database.
55+
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
56+
57+
# Start the server by default, this can be overwritten at runtime
58+
EXPOSE 3000
59+
CMD ["./bin/rails", "server"]

Diff for: Gemfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
source "https://rubygems.org"
2+
3+
ruby "3.2.2"
4+
5+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6+
gem "rails", "~> 7.1.2"
7+
8+
# Use postgresql as the database for Active Record
9+
gem "pg", "~> 1.1"
10+
11+
# Use the Puma web server [https://github.com/puma/puma]
12+
gem "puma", ">= 5.0"
13+
14+
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
15+
# gem "kredis"
16+
17+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
18+
# gem "bcrypt", "~> 3.1.7"
19+
20+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
21+
gem "tzinfo-data", platforms: %i[ windows jruby ]
22+
23+
# Reduces boot times through caching; required in config/boot.rb
24+
gem "bootsnap", require: false
25+
26+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
27+
# gem "image_processing", "~> 1.2"
28+
29+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin Ajax possible
30+
# gem "rack-cors"
31+
32+
group :development, :test do
33+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
34+
gem "debug", platforms: %i[ mri windows ]
35+
end
36+
37+
group :development do
38+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
39+
# gem "spring"
40+
end
41+

Diff for: Gemfile.lock

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (7.1.2)
5+
actionpack (= 7.1.2)
6+
activesupport (= 7.1.2)
7+
nio4r (~> 2.0)
8+
websocket-driver (>= 0.6.1)
9+
zeitwerk (~> 2.6)
10+
actionmailbox (7.1.2)
11+
actionpack (= 7.1.2)
12+
activejob (= 7.1.2)
13+
activerecord (= 7.1.2)
14+
activestorage (= 7.1.2)
15+
activesupport (= 7.1.2)
16+
mail (>= 2.7.1)
17+
net-imap
18+
net-pop
19+
net-smtp
20+
actionmailer (7.1.2)
21+
actionpack (= 7.1.2)
22+
actionview (= 7.1.2)
23+
activejob (= 7.1.2)
24+
activesupport (= 7.1.2)
25+
mail (~> 2.5, >= 2.5.4)
26+
net-imap
27+
net-pop
28+
net-smtp
29+
rails-dom-testing (~> 2.2)
30+
actionpack (7.1.2)
31+
actionview (= 7.1.2)
32+
activesupport (= 7.1.2)
33+
nokogiri (>= 1.8.5)
34+
racc
35+
rack (>= 2.2.4)
36+
rack-session (>= 1.0.1)
37+
rack-test (>= 0.6.3)
38+
rails-dom-testing (~> 2.2)
39+
rails-html-sanitizer (~> 1.6)
40+
actiontext (7.1.2)
41+
actionpack (= 7.1.2)
42+
activerecord (= 7.1.2)
43+
activestorage (= 7.1.2)
44+
activesupport (= 7.1.2)
45+
globalid (>= 0.6.0)
46+
nokogiri (>= 1.8.5)
47+
actionview (7.1.2)
48+
activesupport (= 7.1.2)
49+
builder (~> 3.1)
50+
erubi (~> 1.11)
51+
rails-dom-testing (~> 2.2)
52+
rails-html-sanitizer (~> 1.6)
53+
activejob (7.1.2)
54+
activesupport (= 7.1.2)
55+
globalid (>= 0.3.6)
56+
activemodel (7.1.2)
57+
activesupport (= 7.1.2)
58+
activerecord (7.1.2)
59+
activemodel (= 7.1.2)
60+
activesupport (= 7.1.2)
61+
timeout (>= 0.4.0)
62+
activestorage (7.1.2)
63+
actionpack (= 7.1.2)
64+
activejob (= 7.1.2)
65+
activerecord (= 7.1.2)
66+
activesupport (= 7.1.2)
67+
marcel (~> 1.0)
68+
activesupport (7.1.2)
69+
base64
70+
bigdecimal
71+
concurrent-ruby (~> 1.0, >= 1.0.2)
72+
connection_pool (>= 2.2.5)
73+
drb
74+
i18n (>= 1.6, < 2)
75+
minitest (>= 5.1)
76+
mutex_m
77+
tzinfo (~> 2.0)
78+
base64 (0.2.0)
79+
bigdecimal (3.1.4)
80+
bootsnap (1.17.0)
81+
msgpack (~> 1.2)
82+
builder (3.2.4)
83+
concurrent-ruby (1.2.2)
84+
connection_pool (2.4.1)
85+
crass (1.0.6)
86+
date (3.3.4)
87+
debug (1.8.0)
88+
irb (>= 1.5.0)
89+
reline (>= 0.3.1)
90+
drb (2.2.0)
91+
ruby2_keywords
92+
erubi (1.12.0)
93+
globalid (1.2.1)
94+
activesupport (>= 6.1)
95+
i18n (1.14.1)
96+
concurrent-ruby (~> 1.0)
97+
io-console (0.6.0)
98+
irb (1.9.1)
99+
rdoc
100+
reline (>= 0.3.8)
101+
loofah (2.22.0)
102+
crass (~> 1.0.2)
103+
nokogiri (>= 1.12.0)
104+
mail (2.8.1)
105+
mini_mime (>= 0.1.1)
106+
net-imap
107+
net-pop
108+
net-smtp
109+
marcel (1.0.2)
110+
mini_mime (1.1.5)
111+
minitest (5.20.0)
112+
msgpack (1.7.2)
113+
mutex_m (0.2.0)
114+
net-imap (0.4.6)
115+
date
116+
net-protocol
117+
net-pop (0.1.2)
118+
net-protocol
119+
net-protocol (0.2.2)
120+
timeout
121+
net-smtp (0.4.0)
122+
net-protocol
123+
nio4r (2.6.1)
124+
nokogiri (1.15.5-x86_64-darwin)
125+
racc (~> 1.4)
126+
nokogiri (1.15.5-x86_64-linux)
127+
racc (~> 1.4)
128+
pg (1.5.4)
129+
psych (5.1.1.1)
130+
stringio
131+
puma (6.4.0)
132+
nio4r (~> 2.0)
133+
racc (1.7.3)
134+
rack (3.0.8)
135+
rack-session (2.0.0)
136+
rack (>= 3.0.0)
137+
rack-test (2.1.0)
138+
rack (>= 1.3)
139+
rackup (2.1.0)
140+
rack (>= 3)
141+
webrick (~> 1.8)
142+
rails (7.1.2)
143+
actioncable (= 7.1.2)
144+
actionmailbox (= 7.1.2)
145+
actionmailer (= 7.1.2)
146+
actionpack (= 7.1.2)
147+
actiontext (= 7.1.2)
148+
actionview (= 7.1.2)
149+
activejob (= 7.1.2)
150+
activemodel (= 7.1.2)
151+
activerecord (= 7.1.2)
152+
activestorage (= 7.1.2)
153+
activesupport (= 7.1.2)
154+
bundler (>= 1.15.0)
155+
railties (= 7.1.2)
156+
rails-dom-testing (2.2.0)
157+
activesupport (>= 5.0.0)
158+
minitest
159+
nokogiri (>= 1.6)
160+
rails-html-sanitizer (1.6.0)
161+
loofah (~> 2.21)
162+
nokogiri (~> 1.14)
163+
railties (7.1.2)
164+
actionpack (= 7.1.2)
165+
activesupport (= 7.1.2)
166+
irb
167+
rackup (>= 1.0.0)
168+
rake (>= 12.2)
169+
thor (~> 1.0, >= 1.2.2)
170+
zeitwerk (~> 2.6)
171+
rake (13.1.0)
172+
rdoc (6.6.0)
173+
psych (>= 4.0.0)
174+
reline (0.4.1)
175+
io-console (~> 0.5)
176+
ruby2_keywords (0.0.5)
177+
stringio (3.1.0)
178+
thor (1.3.0)
179+
timeout (0.4.1)
180+
tzinfo (2.0.6)
181+
concurrent-ruby (~> 1.0)
182+
webrick (1.8.1)
183+
websocket-driver (0.7.6)
184+
websocket-extensions (>= 0.1.0)
185+
websocket-extensions (0.1.5)
186+
zeitwerk (2.6.12)
187+
188+
PLATFORMS
189+
x86_64-darwin-19
190+
x86_64-linux
191+
192+
DEPENDENCIES
193+
bootsnap
194+
debug
195+
pg (~> 1.1)
196+
puma (>= 5.0)
197+
rails (~> 7.1.2)
198+
tzinfo-data
199+
200+
RUBY VERSION
201+
ruby 3.2.2p53
202+
203+
BUNDLED WITH
204+
2.4.22

0 commit comments

Comments
 (0)