Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade ruby version #267

Draft
wants to merge 1 commit into
base: beta
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,63 @@ FROM composer:2.5.1 as composer

FROM php:7.4.12-apache AS prod

RUN (curl -sL https://deb.nodesource.com/setup_19.x | bash) \
&& apt-get update \
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git=1:2.20.1-2+deb10u7 \
libghc-gnuidn-dev=0.2.2-7+b1 \
locales=2.28-10+deb10u2 \
nodejs=19.6.0-deb-1nodesource1 \
perl=5.28.1-6+deb10u1 \
python3=3.7.3-1 \
python3-pip=18.1-5 \
ruby-full=1:2.5.1 \
unzip=6.0-23+deb10u3 \
zlib1g-dev=1:1.2.11.dfsg-1+deb10u2 \
&& pip3 install docutils==0.14 \
&& gem install bundler -v 2.3.26 \
&& rm -rf /var/lib/apt/lists/* \
&& python3 --version \
&& ruby --version \
&& bundle config set no-cache 'true' \
&& echo en_US.UTF-8 UTF-8 > /etc/locale.gen \
&& locale-gen \
&& locale -a

ENV LANG=en_US.UTF-8
ENV PATH /var/www/node_modules/.bin:$PATH

WORKDIR /var/www

COPY --from=composer /usr/bin/composer /usr/bin/composer
ENV PATH /var/www/node_modules/.bin:$PATH
COPY package* /var/www/

RUN (curl -sL https://deb.nodesource.com/setup_19.x | bash) \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nodejs=19.6.0-deb-1nodesource1 \
&& rm -rf /var/lib/apt/lists/* \
&& npm install

COPY Gemfile* /var/www/

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libssl-dev \
libyaml-dev \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash \
&& eval "$(~/.rbenv/bin/rbenv init -)" \
&& rbenv install 3.2.0 \
&& rbenv global 3.2.0 \
&& ruby -v \
&& gem install bundler -v 2.3.26 \
&& bundle config set no-cache 'true' \
&& bundler install --jobs $(($(nproc) * 2))

COPY --from=composer /usr/bin/composer /usr/bin/composer

COPY composer.* /var/www/
COPY package* /var/www/

RUN bundler install --jobs $(($(nproc) * 2)) \
&& composer install --no-scripts --no-dev \
&& npm install
RUN composer install --no-scripts --no-dev

COPY . /var/www

ENTRYPOINT /var/www/entrypoint

########################################

FROM prod AS dev
Expand Down
5 changes: 5 additions & 0 deletions entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

eval "$(~/.rbenv/bin/rbenv init -)"

docker-php-entrypoint "$@"