diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d24f3d..1aab40f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,11 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@master + - name: Create master.key + uses: "finnp/create-file-action@master" + env: + FILE_NAME: "config/master.key" + FILE_DATA: ${{ secrets.SECRET_KEY_BASE }} - name: Login to Heroku run: heroku container:login env: diff --git a/Dockerfile b/Dockerfile index df1e7dd..0de0575 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,14 +23,24 @@ yarn COPY ./entrypoint.sh /usr/bin/entrypoint.sh RUN chmod +x /usr/bin/entrypoint.sh +ENTRYPOINT ["entrypoint.sh"] + RUN gem install bundler --version "$BUNDLE_VERSION" -COPY . . +COPY ./Gemfile . +COPY ./Gemfile.lock . RUN bundle install --jobs 20 --retry 5 +COPY ./package.json . +COPY ./yarn.lock . + RUN yarn -ENTRYPOINT ["entrypoint.sh"] +COPY . . -CMD ["rails", "s", "-b", "0.0.0.0"] \ No newline at end of file +RUN chmod 600 config/master.key + +RUN bundle exec rails assets:precompile + +CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"] \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index f37db58..6a042a2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,7 +25,7 @@ Rails.application.configure do config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + config.assets.js_compressor = Uglifier.new(harmony: true) # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed.