Skip to content

Commit be7d1f6

Browse files
committed
initial commit
0 parents  commit be7d1f6

Some content is hidden

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

78 files changed

+1679
-0
lines changed

.dockerignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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
32+
33+
# Ignore assets.
34+
/node_modules/
35+
/app/assets/builds/*
36+
!/app/assets/builds/.keep
37+
/public/assets

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2+
3+
4+
# Mark any vendored files as having been vendored.
5+
vendor/* linguist-vendored
6+
config/credentials/*.yml.enc diff=rails_credentials
7+
config/credentials.yml.enc diff=rails_credentials

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
/public/assets
33+
34+
# Ignore master key for decrypting credentials and more.
35+
/config/master.key
36+
37+
/app/assets/builds/*
38+
!/app/assets/builds/.keep

.rubocop.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Layout/LineLength:
2+
Max: 150
3+
AllowedPatterns:
4+
- '\A#'
5+
6+
Style/AccessorGrouping:
7+
EnforcedStyle: separated
8+
9+
Style/Documentation:
10+
Enabled: false
11+
12+
Style/WordArray:
13+
Enabled: false
14+
15+
Style/SymbolArray:
16+
Enabled: false
17+
18+
AllCops:
19+
NewCops: enable
20+

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-3.0.4

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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.0.4
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 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+
29+
# Copy application code
30+
COPY . .
31+
32+
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
33+
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
34+
35+
36+
# Final stage for app image
37+
FROM base
38+
39+
# Install packages needed for deployment
40+
RUN apt-get update -qq && \
41+
apt-get install --no-install-recommends -y curl && \
42+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
43+
44+
# Copy built artifacts: gems, application
45+
COPY --from=build /usr/local/bundle /usr/local/bundle
46+
COPY --from=build /rails /rails
47+
48+
# Run and own only the runtime files as a non-root user for security
49+
RUN useradd rails --create-home --shell /bin/bash && \
50+
chown -R rails:rails log tmp
51+
USER rails:rails
52+
53+
# Entrypoint prepares the database.
54+
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
55+
56+
# Start the server by default, this can be overwritten at runtime
57+
EXPOSE 3000
58+
CMD ["./bin/rails", "server"]

Gemfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
ruby '3.0.4'
6+
7+
gem 'rails', '~> 7.1.3'
8+
9+
gem 'importmap-rails'
10+
gem 'propshaft'
11+
gem 'puma', '>= 5.0'
12+
gem 'stimulus-rails'
13+
gem 'tailwindcss-rails'
14+
15+
group :development, :test do
16+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
17+
gem 'debug', platforms: %i[mri mswin mswin64 mingw x64_mingw]
18+
end
19+
20+
group :development do
21+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
22+
# gem "spring"
23+
gem 'web-console'
24+
end

0 commit comments

Comments
 (0)