Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for Modern 7.2 #58

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 7 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-west-2

# SWITCH MYSQL: enable these environment
# MYSQL_URL=mysql
# MYSQL_DATABASE=starter_dev
S3_URL=http://s3:9090
AWS_BUCKET_NAME=files

SMTP_HOST=mailhog
SMTP_PORT=1025
SMTP_USERNAME=
SMTP_PASSWORD=
52 changes: 30 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# 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'
# Temporary files generated by your text editor or operating system
# belong in git's global ignore instead:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all environment files (except templates).
/.env*
!/.env*.erb

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

/node_modules
/yarn-error.log

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

# Ignore Docker Volumes
.redis
# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
/public/assets

# Ignore Test Coverage
/coverage
# Ignore master key for decrypting credentials and more.
/config/master.key

# Ignore local config overrides
.env.development.local
/app/assets/builds/*
!/app/assets/builds/.keep

# Ignore local activestorage files
storage/
/node_modules

# General Ignores
.vscode/
Expand All @@ -50,3 +50,11 @@ storage/
# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Vite Ruby
/public/vite*
node_modules
# Vite uses dotenv and suggests to ignore local-only env files. See
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local

3 changes: 0 additions & 3 deletions .rspec

This file was deleted.

4 changes: 1 addition & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
require:
- rubocop-factory_bot
- rubocop-performance
- rubocop-rails
- rubocop-rspec

inherit_gem:
prettier: rubocop.yml
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

Rails:
Enabled: true
Expand Down
87 changes: 37 additions & 50 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,58 +1,45 @@
FROM ruby:3.1.3-bullseye AS deps

ENV DEBIAN_FRONTEND=noninteractive
ENV BUNDLE_BUILD__SASSC=--disable-march-tune-native

RUN apt update -qq \
&& apt install -qy \
build-essential \
ca-certificates \
curl \
gnupg \
# libmariadb-dev \ # SWITCH MYSQL: install mariadb, and remove postgresql
# mariadb-client \
postgresql-client-13 \
postgresql-contrib-13 \
&& rm -rf /var/lib/apt/lists/*


# Install Node. Requires curl, ca-certificates, gnupg from above
ENV NODE_MAJOR=18
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y nodejs && \
rm -rf /etc/apt/keyrings/nodesource.gpg /etc/apt/sources.list.d/nodesource.list

ENV BUNDLE_JOBS=5 \
BUNDLE_PATH=/bundle \
BUNDLE_BIN=/bundle/bin \
GEM_HOME=/bundle


RUN gem update --system
RUN gem install bundler

RUN bundle config set force_ruby_platform true

FROM public.ecr.aws/docker/library/ruby:3.3-alpine3.19 AS runner

ENV APP_HOME="/app"
ENV BUNDLE_BIN="/bundle/bin"
ENV DEBIAN_FRONTEND="noninteractive"
ENV BUNDLE_BUILD__SASSC="--disable-march-tune-native"
ENV BUNDLE_JOBS="5"
ENV BUNDLE_PATH="/bundle"
ENV GEM_HOME="/bundle"
ENV BUNDLE_GEMFILE="$APP_HOME/Gemfile"
ENV PATH="${BUNDLE_BIN}:${PATH}"

ENV APP_HOME /app
WORKDIR $APP_HOME

# Update Gems first...only re-do this when bundler version changes.
# If we need to force a gem update we'll have to `--no-cache` or add a file we can copy in
RUN gem update --system && gem install bundler:2.5.21

FROM deps as dev

CMD ["tail", "-f", "/dev/null"]

FROM deps as runner

COPY Gemfile Gemfile.lock $APP_HOME/
ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile

RUN bundle check || bundle install

COPY ./docker/.apkcache .
RUN apk add --update --no-cache \
alpine-sdk \
ca-certificates \
curl \
bash \
fontconfig \
graphviz \
gcompat \
imagemagick \
imagemagick-jpeg \
imagemagick-pdf \
msttcorefonts-installer \
nodejs \
npm \
libpq-dev \
postgresql13-dev \
vips-dev \
&& rm ./.apkcache

COPY ./Gemfile ./Gemfile.lock ./
RUN bundle install && rm ./Gemfile ./Gemfile.lock

COPY ./docker/confs/minimagick-policy.xml /etc/ImageMagick-6/
COPY . $APP_HOME/

EXPOSE 3000
Expand Down
Loading