Skip to content

Instantly share code, notes, and snippets.

View crusadergo's full-sized avatar

Ilia Lazarev crusadergo

View GitHub Profile
@crusadergo
crusadergo / Dockerfile
Created November 14, 2019 10:56 — forked from webchi/Dockerfile
Rails Postgre Docker MultiStage
FROM ruby:2.5.5-alpine3.9 as builder
WORKDIR /app
ARG RAILS_MASTER_KEY
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_IGNORE_MESSAGES=1 \
BUNDLE_GITHUB_HTTPS=1 \
BUNDLE_FROZEN=1 \
@crusadergo
crusadergo / async_rake.rb
Created December 1, 2020 10:52 — forked from tompave/async_rake.rb
how to run rake tasks asynchronously from controllers by spawning child processes
class ApplicationController < ActionController::Base
private
# Runs a rake task asyncronously in a child process
#
# for example, in any controller:
# async_rake("async:import_fixtures")
# async_rake("db:maintenance:cleanup", table: "things", ids: [12, 114, 539])
#