-
Notifications
You must be signed in to change notification settings - Fork 4
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
Oleg Hasjanov
authored and
Oleg Hasjanov
committed
Jan 5, 2024
1 parent
49b0fd3
commit 684b9e6
Showing
1 changed file
with
53 additions
and
18 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 |
---|---|---|
@@ -1,24 +1,59 @@ | ||
FROM internetee/ruby:3.2.2 | ||
ARG RAILS_ENV | ||
ARG SECRET_KEY_BASE | ||
ARG APP_DBHOST | ||
# FROM internetee/ruby:3.2.2 | ||
# ARG RAILS_ENV | ||
# ARG SECRET_KEY_BASE | ||
# ARG APP_DBHOST | ||
|
||
ENV RAILS_ENV "$RAILS_ENV" | ||
ENV SECRET_KEY_BASE "$SECRET_KEY_BASE" | ||
ENV APP_DBHOST "$APP_DBHOST" | ||
# ENV RAILS_ENV "$RAILS_ENV" | ||
# ENV SECRET_KEY_BASE "$SECRET_KEY_BASE" | ||
# ENV APP_DBHOST "$APP_DBHOST" | ||
|
||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B | ||
RUN apt-get update | ||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - | ||
RUN apt-get install -y nodejs | ||
# # RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B | ||
# # RUN apt-get update | ||
# # RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - | ||
# # RUN apt-get install -y nodejs | ||
|
||
# RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - | ||
# RUN apt-get install -y --no-install-recommends > /dev/null \ | ||
# nodejs=* \ | ||
# && apt-get clean \ | ||
# && rm -rf /var/lib/apt/lists/* | ||
|
||
# RUN npm install -g yarn@latest | ||
# WORKDIR /opt/webapps/app | ||
# # COPY Gemfile Gemfile.lock ./ | ||
# # RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5 | ||
# # COPY package.json yarn.lock ./ | ||
# # RUN yarn install --check-files | ||
# # COPY . . | ||
# # RUN bundle exec rails assets:precompile | ||
|
||
# COPY Rakefile Gemfile Gemfile.lock ./ | ||
# RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5 | ||
# COPY package.json yarn.lock ./ | ||
# RUN yarn install --check-files | ||
|
||
# RUN bundle exec rails assets:precompile | ||
|
||
# EXPOSE 3000 | ||
|
||
FROM internetee/ruby:3.2.2-refactor as base | ||
|
||
RUN npm install -g yarn@latest | ||
WORKDIR /opt/webapps/app | ||
COPY Gemfile Gemfile.lock ./ | ||
COPY --link Gemfile Gemfile.lock ./ | ||
RUN gem install bundler && bundle config set without 'development test' && bundle install --jobs 20 --retry 5 | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install --check-files | ||
COPY . . | ||
RUN bundle exec rails assets:precompile | ||
COPY --link package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile | ||
|
||
FROM base | ||
|
||
RUN useradd rails | ||
RUN mkdir -p /home/rails && chown rails:rails /home/rails | ||
|
||
USER rails:rails | ||
|
||
RUN mkdir -p /opt/webapps/app/tmp/pids | ||
|
||
COPY --from=base --chown=rails:rails /usr/local/bundle /usr/local/bundle | ||
COPY --from=base --chown=rails:rails /opt/webapps/app /opt/webapps/app | ||
|
||
EXPOSE 3000 | ||
EXPOSE 3000 |