|
| 1 | +FROM php:8.4-apache |
| 2 | + |
| 3 | +EXPOSE 80 |
| 4 | + |
| 5 | +ENV APACHE_RUN_USER=www-data |
| 6 | +ENV APACHE_RUN_GROUP=www-data |
| 7 | +ENV APACHE_LOCK_DIR=/var/lock/apache2 |
| 8 | +ENV APACHE_LOG_DIR=/var/log/apache2 |
| 9 | +ENV APACHE_PID_FILE=/var/run/apache2/apache2.pid |
| 10 | +ENV APACHE_SERVER_NAME=php-docker-base-linkorb |
| 11 | + |
| 12 | +COPY ./php.ini-production "$PHP_INI_DIR/php.ini" |
| 13 | + |
| 14 | +COPY ./apache2.conf /etc/apache2/apache2.conf |
| 15 | +COPY ./apache-vhost.conf /etc/apache2/sites-available/000-default.conf |
| 16 | +COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/ |
| 17 | +COPY --from=composer /usr/bin/composer /usr/bin/composer |
| 18 | + |
| 19 | +RUN apt-get update \ |
| 20 | + && apt-get dist-upgrade -y \ |
| 21 | + && apt-get install -y --no-install-recommends \ |
| 22 | + curl \ |
| 23 | + git \ |
| 24 | + gosu \ |
| 25 | + iputils-ping \ |
| 26 | + joe \ |
| 27 | + jq \ |
| 28 | + libbz2-dev \ |
| 29 | + openssh-client \ |
| 30 | + software-properties-common \ |
| 31 | + telnet \ |
| 32 | + unzip \ |
| 33 | + vim \ |
| 34 | + zip \ |
| 35 | + ca-certificates \ |
| 36 | + gnupg \ |
| 37 | + tidy \ |
| 38 | + wkhtmltopdf \ |
| 39 | + pdftk \ |
| 40 | + libxml2-dev \ |
| 41 | + && apt-get autoremove \ |
| 42 | + && apt-get clean \ |
| 43 | + && rm -rf /var/lib/apt/lists/* |
| 44 | + |
| 45 | + |
| 46 | +ENV NODE_MAJOR=20 |
| 47 | +# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions |
| 48 | +RUN mkdir -p /etc/apt/keyrings \ |
| 49 | + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ |
| 50 | + | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ |
| 51 | + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ |
| 52 | + && apt-get update \ |
| 53 | + && apt-get install nodejs -y \ |
| 54 | + && apt-get autoremove \ |
| 55 | + && apt-get clean \ |
| 56 | + && rm -rf /var/lib/apt/lists/* |
| 57 | + |
| 58 | +RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg \ |
| 59 | + | gpg --dearmor >> /usr/share/keyrings/yarnkey.gpg \ |
| 60 | + && echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list \ |
| 61 | + && apt-get update \ |
| 62 | + && apt-get install yarn \ |
| 63 | + && apt-get autoremove \ |
| 64 | + && apt-get clean \ |
| 65 | + && rm -rf /var/lib/apt/lists/* |
| 66 | + |
| 67 | +RUN docker-php-ext-install bz2 \ |
| 68 | + && install-php-extensions apcu gd gmp intl opcache pdo_mysql pdo_pgsql sockets zip imap mailparse soap mysqli bcmath \ |
| 69 | + && apt-get autoremove \ |
| 70 | + && apt-get clean \ |
| 71 | + && rm -rf /var/lib/apt/lists/* |
| 72 | + |
| 73 | +RUN mkdir -p /app/config/secrets/dev \ |
| 74 | + && mkdir -p /app/public/build \ |
| 75 | + && chown -R www-data:www-data /app \ |
| 76 | + && chown -R www-data:www-data /var/www \ |
| 77 | + && a2enmod rewrite \ |
| 78 | + && a2enmod headers |
| 79 | + |
| 80 | +COPY --chown=www-data:www-data index.html /app |
| 81 | + |
| 82 | +WORKDIR /app |
| 83 | + |
| 84 | +USER root |
0 commit comments