Skip to content

Commit 795bc04

Browse files
committed
initial commit
0 parents  commit 795bc04

File tree

95 files changed

+1690
-0
lines changed

Some content is hidden

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

95 files changed

+1690
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "RailsApp Container",
3+
"dockerComposeFile": ["../../docker-compose.yml"],
4+
"service": "app",
5+
"shutdownAction": "stopCompose",
6+
"workspaceFolder": "/workspace"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "DB Container",
3+
"dockerComposeFile": ["../../docker-compose.yml"],
4+
"service": "db",
5+
"shutdownAction": "stopCompose",
6+
"workspaceFolder": "/workspace"
7+
}

.dockerignore

+37
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

+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

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-3.2.4

Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Stage 1: Builder (base image that can be used for local deve or to run unit tests on CI)
4+
FROM ruby:3.2.4 as builder
5+
RUN mkdir /workspace
6+
WORKDIR /workspace
7+
RUN apt-get update -qq && \
8+
apt-get -y install build-essential
9+
ADD Gemfile /workspace/Gemfile
10+
ADD Gemfile.lock /workspace/Gemfile.lock
11+
RUN bundle install
12+
13+
# Stage 2: develop (for local development setup)
14+
FROM builder as develop
15+
WORKDIR /workspace
16+
CMD [ "bundle", "exec", "rails", "s", "-b", "0.0.0.0" ]
17+
18+
# Stage 3: prod-build (intermediate stage that builds prod artifacts)
19+
FROM builder as prod-build
20+
COPY . /workspace
21+
RUN rails assets:precompile
22+
RUN bundle config set --local without 'development test' && \
23+
bundle config set --local path /rubygems
24+
RUN bundle install
25+
26+
# Stage 4: prod (image that will be deployed all of the environments - qa, staging, prod etc.)
27+
FROM ruby:3.2.4-slim as prod
28+
RUN mkdir /workspace
29+
WORKDIR /workspace
30+
COPY --from=prod-build /workspace /workspace
31+
COPY --from=prod-build /rubygems /rubygems
32+
COPY --from=prod-build /usr/lib/aarch64-linux-gnu/libmariadb.so.3 /usr/lib/aarch64-linux-gnu/libmariadb.so.3
33+
RUN bundle config set --local without 'development test' && \
34+
bundle config set --local path /rubygems
35+
# RUN useradd rails --create-home --shell /bin/bash && \
36+
# chown -R rails:rails db log storage tmp
37+
# USER rails:rails
38+
CMD [ "bundle", "exec", "rails", "s", "-b", "0.0.0.0" ]

Gemfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
source "https://rubygems.org"
2+
3+
ruby "3.2.4"
4+
5+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6+
gem "rails", "~> 7.1.3", ">= 7.1.3.2"
7+
8+
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
9+
gem "sprockets-rails"
10+
11+
# # Use sqlite3 as the database for Active Record
12+
# gem "sqlite3", "~> 1.4"
13+
14+
gem 'mysql2'
15+
16+
# Use the Puma web server [https://github.com/puma/puma]
17+
gem "puma", ">= 5.0"
18+
19+
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
20+
gem "importmap-rails"
21+
22+
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
23+
gem "turbo-rails"
24+
25+
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
26+
gem "stimulus-rails"
27+
28+
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
29+
gem "jbuilder"
30+
31+
# Use Redis adapter to run Action Cable in production
32+
# gem "redis", ">= 4.0.1"
33+
34+
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
35+
# gem "kredis"
36+
37+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
38+
# gem "bcrypt", "~> 3.1.7"
39+
40+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
41+
gem "tzinfo-data", platforms: %i[ windows jruby ]
42+
43+
# Reduces boot times through caching; required in config/boot.rb
44+
gem "bootsnap", require: false
45+
46+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
47+
# gem "image_processing", "~> 1.2"
48+
49+
group :development, :test do
50+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
51+
gem "debug", platforms: %i[ mri windows ]
52+
end
53+
54+
group :development do
55+
# Use console on exceptions pages [https://github.com/rails/web-console]
56+
gem "web-console"
57+
58+
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
59+
# gem "rack-mini-profiler"
60+
61+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
62+
# gem "spring"
63+
end
64+
65+
group :test do
66+
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
67+
gem "capybara"
68+
gem "selenium-webdriver"
69+
end

0 commit comments

Comments
 (0)