config updates. docker build updates.

This commit is contained in:
snogrammer 2021-06-16 18:10:02 -06:00
parent 81a13d208f
commit 30a299a863
8 changed files with 43 additions and 23 deletions

3
.gitignore vendored
View File

@ -14,7 +14,8 @@
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
/tmp/*/*
/tmp/*.txt
!/log/.keep
!/tmp/.keep

34
Dockerfile.production Normal file
View File

@ -0,0 +1,34 @@
# https://pkgs.alpinelinux.org/packages?name=ruby&branch=v3.11
FROM ruby:2.7-alpine3.11
# ENV BUNDLER_VERSION=2.0.2
# Minimal requirements to run a Rails app
RUN apk add --no-cache --update build-base \
linux-headers \
postgresql-dev \
nodejs \
tzdata \
git \
less \
chromium \
chromium-chromedriver \
yarn
WORKDIR /app
COPY Gemfile* ./
# Bundler workaround
# https://stackoverflow.com/a/58102398
RUN gem install bundler:2.2.2
RUN bundle config set --local without 'development test'
RUN bundle install --jobs 5 --retry 5
# Copy the application into the container
COPY . .
# Precompile Rails assets
RUN SECRET_KEY_BASE=`bin/rake secret` RAILS_ENV=production bundle exec rake assets:clean assets:precompile
# Start puma
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

View File

@ -11,11 +11,12 @@ This repo is a designed to be a Dockerized Rails 6 template:
## Setup
- `bundle`
- `bundle update`
- `Download latest copy of FontAwesome and replace vendor/fontawesome-pro/** (npm auth access has expired)`
- `yarn install --check-files`
- `Find/replace all TODO`
- `docker-compose up --build`
- `docker-compose run app rails db:setup`
### Dependencies

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
ActiveAdmin.register User do
permit_params proc: User.attribute_names
permit_params(proc { User.attribute_names })
index do
selectable_column

View File

@ -59,7 +59,7 @@ html {
}
}
.privacy-policy, .cookie-policy {
.privacy-policy, .dac9630aec-policy {
padding: $size-7;
}
}

View File

@ -18,7 +18,7 @@
<p><%= link_to("Privacy Policy", privacy_path) %></p>
</div>
<div class="cookie-policy is-size-7">
<div class="dac9630aec-policy is-size-7">
<p><%= fa_icon("cookie-bite", type: :duotone, size: "3x") %></p>
<p>

View File

@ -1,15 +0,0 @@
default: &default
short_name: '# TODO: Change in config/app.yml'
title: '# TODO: Change in config/app.yml'
development:
<<: *default
test:
<<: *default
staging:
<<: *default
production:
<<: *default

View File

@ -22,9 +22,8 @@ require 'sprockets/railtie'
Bundler.require(*Rails.groups)
module App
CONFIG = Application.configuration.x.app = config_for(:app)
SHORT_NAME = CONFIG.short_name
TITLE = CONFIG.title
SHORT_NAME = 'app_name' # TODO: Change in config/application.rb
TITLE = 'App Title' # TODO: Change in config/application.rb
class Application < Rails::Application
config.x.redis = config_for(:redis)