Skip to content

Commit

Permalink
Merge branch 'release/0.20.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Buchholz committed Feb 10, 2022
2 parents cf1a037 + 04bdf34 commit b7d1330
Showing 1 changed file with 39 additions and 48 deletions.
87 changes: 39 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,58 @@ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
PHP_FPM_PM="ondemand" \
PHP_FPM_PROCESS_IDLE_TIMEOUT="10s"

# create working dir
RUN mkdir /opt/app
WORKDIR /opt/app

# install wait-for-it
ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/wait-for-it.sh

# copy runit services
COPY ./etc/service/ /etc/service/
RUN find /etc/service/ -name "run" -exec chmod -v +x {} \;

# copy nginx config files
COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf

# copy php config files
COPY ./usr/local/etc/php/ /usr/local/etc/php/
COPY ./usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/

# copy bin files
COPY ./usr/local/bin/startup-commands.php /usr/local/bin/

# copy root folder and make run scripts executable
COPY ./root/ /root/
RUN find /root -name "*.sh" -exec chmod -v +x {} \;

RUN apk info \
&& echo @iconv-fix http://dl-cdn.alpinelinux.org/alpine/v3.13/community >> /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
&& apk add --no-cache \
sudo \
runit \
nginx \
zlib-dev \
icu-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
libxml2-dev \
freetype-dev \
gnu-libiconv@iconv-fix=1.15-r3 \
sudo \
bash \
runit \
nginx \
git \
nodejs \
npm \
composer \
yarn \
mysql-client \
mariadb-connector-c \
php8-dom \
php8-tokenizer \
php8-xml \
php8-xmlwriter \
php8-fileinfo \
yarn \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
Expand All @@ -50,60 +73,28 @@ RUN apk info \
intl \
opcache \
pcntl \
iconv \
xml \
xmlwriter \
dom \
tokenizer \
fileinfo \
&& pecl install \
redis \
&& docker-php-ext-enable redis \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/cache/apk/*

# fix iconv (see https://github.com/docker-library/php/issues/240#issuecomment-876464325)
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so

# change default shell
SHELL ["/bin/bash", "-c"]

# create working dir
RUN mkdir /opt/app
WORKDIR /opt/app

# install wait-for-it
ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/wait-for-it.sh

# copy runit services
COPY ./etc/service/ /etc/service/
RUN find /etc/service/ -name "run" -exec chmod -v +x {} \;

# copy nginx config files
COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf

# copy php config files
COPY ./usr/local/etc/php/ /usr/local/etc/php/
COPY ./usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/

# copy bin files
COPY ./usr/local/bin/startup-commands.php /usr/local/bin/
COPY --from=composer /usr/bin/composer /usr/bin/composer

# configure composer
ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
PATH="$PATH:/opt/app/vendor/bin:~/.composer/vendor/bin"

# fix iconv (see https://github.com/docker-library/php/issues/240#issuecomment-876464325)
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so

# configure yarn
RUN yarn config set strict-ssl false && \
yarn global add cross-env

# copy root folder and make run scripts executable
COPY ./root/ /root/
RUN find /root -name "*.sh" -exec chmod -v +x {} \;
# change default shell
SHELL ["/bin/bash", "-c"]

# run the application
ENTRYPOINT ["/root/entrypoint.sh"]
Expand Down

0 comments on commit b7d1330

Please sign in to comment.