-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,754 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM ruby:3.1.2 | ||
|
||
# Install node & yarn | ||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
RUN apt-get install -y nodejs | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt-get update && apt-get install -y yarn | ||
|
||
# Install base deps or additional (e.g. tesseract) | ||
ARG INSTALL_DEPENDENCIES | ||
RUN apt-get update -qq \ | ||
&& apt-get install -y --no-install-recommends ${INSTALL_DEPENDENCIES} \ | ||
build-essential libpq-dev git \ | ||
&& apt-get clean autoclean \ | ||
&& apt-get autoremove -y \ | ||
&& rm -rf \ | ||
/var/lib/apt \ | ||
/var/lib/dpkg \ | ||
/var/lib/cache \ | ||
/var/lib/log | ||
|
||
# Install deps with bundler | ||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY Gemfile* /app/ | ||
ARG BUNDLE_INSTALL_ARGS | ||
RUN gem install bundler:2.3.25 | ||
RUN bundle config set without 'development test' | ||
RUN bundle install ${BUNDLE_INSTALL_ARGS} \ | ||
&& rm -rf /usr/local/bundle/cache/* \ | ||
&& find /usr/local/bundle/gems/ -name "*.c" -delete \ | ||
&& find /usr/local/bundle/gems/ -name "*.o" -delete | ||
COPY . /app/ | ||
|
||
# Compile assets | ||
ARG RAILS_ENV=development | ||
RUN if [ "$RAILS_ENV" = "production" ]; then SECRET_KEY_BASE=$(rake secret) bundle exec rake assets:precompile; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM ruby:3.1.2 | ||
|
||
RUN apt-get update -yq \ | ||
&& apt-get upgrade -yq \ | ||
#ESSENTIALS | ||
&& apt-get install -y -qq --no-install-recommends build-essential curl git-core vim passwd unzip cron gcc wget netcat \ | ||
# RAILS PACKAGES NEEDED | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends imagemagick postgresql-client \ | ||
# INSTALL NODE | ||
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \ | ||
&& apt-get install -y --no-install-recommends nodejs \ | ||
# INSTALL YARN | ||
&& npm install -g yarn | ||
|
||
# Clean cache and temp files, fix permissions | ||
RUN apt-get clean -qy \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock | ||
RUN yarn install | ||
|
||
# install specific version of bundler | ||
RUN gem install bundler -v 2.2.32 | ||
|
||
ENV BUNDLE_GEMFILE=/app/Gemfile \ | ||
BUNDLE_JOBS=20 \ | ||
BUNDLE_PATH=/bundle \ | ||
BUNDLE_BIN=/bundle/bin \ | ||
GEM_HOME=/bundle | ||
ENV PATH="${BUNDLE_BIN}:${PATH}" | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install --binstubs --without development test | ||
|
||
COPY . . | ||
|
||
ENV RAILS_ENV production | ||
ENV RAILS_SERVE_STATIC_FILES 1 | ||
ENV RAILS_LOG_TO_STDOUT 1 | ||
|
||
RUN SECRET_KEY_BASE=skb DB_ADAPTER=nulldb bundle exec rails assets:precompile | ||
|
||
RUN chmod +x entrypoint.sh | ||
ENTRYPOINT ["./entrypoint.sh"] | ||
|
||
EXPOSE 3000 | ||
CMD bundle exec puma -C config/puma.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.