Skip to content

Commit 84ce796

Browse files
committed
fix bundle path issue
1 parent f7f090e commit 84ce796

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

dockerfiles/v1/focal260-amazonlinux

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM amazonlinux:2.0.20240620.0 AS amazonlinux
2+
SHELL ["/bin/bash", "-c"]
23

34
FROM ubuntu:20.04 AS bbb-playback
45
ENV DEBIAN_FRONTEND=noninteractive
@@ -47,46 +48,45 @@ ENV NGINX_HOSTNAME=localhost
4748
CMD [ "/etc/nginx/start", "-g", "daemon off;" ]
4849

4950
FROM amazonlinux-base AS base
50-
# Install Node.js (needed for yarn)
51+
# Install basic packages
5152
RUN yum -y install git gcc-c++ make libyaml-devel libffi-devel glibc-devel readline-devel openssl-devel
53+
# Install Node.js (needed for yarn)
5254
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash -
5355
RUN yum -y install nodejs
54-
# Install Ruby & Rails
56+
# Install other packages
5557
RUN curl -sL -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo
5658
RUN amazon-linux-extras enable postgresql14 \
57-
&& yum -y install tar gzip yarn shared-mime-info libxslt zlib-devel sqlite-devel mariadb-devel libpq-devel
58-
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && \
59-
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && \
60-
echo 'eval "$(rbenv init -)"' >> ~/.bashrc && \
61-
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build && \
62-
~/.rbenv/bin/rbenv install 3.3.6 && \
63-
~/.rbenv/bin/rbenv global 3.3.6 && \
64-
~/.rbenv/bin/rbenv rehash
59+
&& yum -y install tar gzip yarn shared-mime-info libxslt zlib-devel sqlite-devel mariadb-devel libpq-devel python3 python3-pip shadow-utils
60+
# Install Ruby
61+
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv && \
62+
git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build && \
63+
/root/.rbenv/bin/rbenv install 3.3.6 && \
64+
/root/.rbenv/bin/rbenv global 3.3.6 && \
65+
/root/.rbenv/bin/rbenv rehash
6566
ENV PATH="/root/.rbenv/shims:/root/.rbenv/bin:$PATH"
66-
RUN yum -y install python3 python3-pip shadow-utils
6767
RUN gem install bundler -v '~> 2.5'
68-
68+
# Setup user scalelite
6969
RUN groupadd scalelite --gid 1000 && \
7070
useradd -u 1000 -d /srv/scalelite -g scalelite scalelite
7171
RUN groupadd scalelite-spool --gid 2000 && \
7272
usermod -a -G scalelite-spool scalelite
73+
USER scalelite:scalelite
7374
WORKDIR /srv/scalelite
75+
RUN echo 'export PATH="/root/.rbenv/bin:$PATH"' >> ~/.bashrc && \
76+
echo 'eval "$(/root/.rbenv/bin/rbenv init -)"' >> ~/.bashrc
7477

7578
FROM base as builder
76-
RUN rm -rf nginx
77-
USER scalelite:scalelite
7879
COPY --chown=scalelite:scalelite Gemfile* ./
79-
RUN bundle --version
80-
RUN bundle config build.nokogiri --use-system-libraries
81-
RUN bundle config set --local deployment 'true'
82-
RUN bundle config set --local without 'development:test'
83-
RUN bundle install -j4
84-
RUN rm -rf vendor/bundle/ruby/*/cache
85-
RUN find vendor/bundle/ruby/*/gems/ \( -name '*.c' -o -name '*.o' \) -delete
80+
RUN source ~/.bashrc && bundle --version && \
81+
bundle config build.nokogiri --use-system-libraries && \
82+
bundle config set --local deployment 'true' && \
83+
bundle config set --local without 'development:test' && \
84+
bundle install -j4 && \
85+
rm -rf vendor/bundle/ruby/*/cache && \
86+
find vendor/bundle/ruby/*/gems/ \( -name '*.c' -o -name '*.o' \) -delete
8687
COPY --chown=scalelite:scalelite . ./
8788

8889
FROM base AS application
89-
USER scalelite:scalelite
9090
ENV RAILS_ENV=production RAILS_LOG_TO_STDOUT=true
9191
COPY --from=builder --chown=scalelite:scalelite /srv/scalelite ./
9292

0 commit comments

Comments
 (0)