-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed local base image to use prod as base
- Loading branch information
Showing
26 changed files
with
274 additions
and
577 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,41 +1,45 @@ | ||
ARG PHP_VERSION | ||
ARG PHP_SHORT_VERSION | ||
FROM druidfi/drupal-web:php-${PHP_VERSION} AS base | ||
ARG PHP_VERSION=8.4 | ||
ARG PHP_SHORT_VERSION=84 | ||
FROM ghcr.io/city-of-helsinki/drupal-docker-base:${PHP_VERSION}-dev AS base | ||
|
||
COPY --from=ghcr.io/city-of-helsinki/drupal-oc-cli:latest /usr/bin/oc /usr/bin/oc | ||
ENV DRUPAL_DB_NAME=drupal \ | ||
DRUPAL_DB_USER=drupal \ | ||
DRUPAL_DB_PASS=drupal \ | ||
DRUPAL_DB_HOST=db \ | ||
DRUPAL_DB_PORT=3306 | ||
|
||
RUN sudo apk add --no-cache jq openssl | ||
ENV SIMPLETEST_DB="mysql://${DRUPAL_DB_USER}:${DRUPAL_DB_PASS}@${DRUPAL_DB_HOST}:${DRUPAL_DB_PORT}/${DRUPAL_DB_NAME}" | ||
|
||
RUN sudo composer self-update | ||
COPY --from=ghcr.io/city-of-helsinki/drupal-oc-cli:latest /usr/bin/oc /usr/bin/oc | ||
|
||
COPY entrypoints/ /entrypoints | ||
COPY files/ / | ||
|
||
# Override default fpm pool conf to run nginx and php-fpm as same user. | ||
COPY php-fpm-pool.conf /etc/php${PHP_SHORT_VERSION}/php-fpm.d/www.conf | ||
RUN chmod +x /entrypoints/* | ||
|
||
# Add druid user to nginx group to prevent permission issues with drush and 'asset://' | ||
# files. | ||
RUN sudo addgroup druid nginx | ||
COPY files/etc/nginx /etc/nginx | ||
|
||
RUN sudo -u root touch /tmp/xdebug.log && \ | ||
sudo chmod 666 /tmp/xdebug.log | ||
# The old druidfi/drupal-web image used /app folder. Symlink it to | ||
# keep this compatible with it. | ||
RUN ln -s /var/www/html /app | ||
|
||
RUN sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ | ||
ARG PHP_SHORT_VERSION | ||
# Remove opcache-recommended.ini because we make several performance | ||
# changes to OPcache settings that may hinder local development. | ||
RUN rm /etc/php${PHP_SHORT_VERSION}/conf.d/opcache-recommended.ini | ||
|
||
# Generate a self-signed cert for nginx. We use selenium+chromium to run | ||
# Functional javascript tests and it forces all requests to use https now. | ||
# We have a nginx config with a self-signed cert to proxy https requests | ||
# to 8080 port. | ||
# @see files/etc/nginx/http.d/ssl-proxy.conf | ||
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ | ||
-subj "/C=FI/ST=Uusimaa/L=Helsinki" \ | ||
-keyout /etc/ssl/private/cert.key \ | ||
-out /etc/ssl/certs/cert.crt | ||
|
||
ENV SIMPLETEST_DB="mysql://${DRUPAL_DB_USER}:${DRUPAL_DB_PASS}@${DRUPAL_DB_HOST}:${DRUPAL_DB_PORT}/${DRUPAL_DB_NAME}" | ||
|
||
FROM base AS php83 | ||
RUN sudo apk --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/releases add php83-pecl-imagick php83-pecl-pcov | ||
|
||
FROM base AS php84 | ||
RUN sudo apk --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
RUN apk --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/releases add php84-pecl-imagick php84-pecl-pcov | ||
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/releases add php84-pecl-xdebug php84-pecl-pcov | ||
|
||
COPY files/etc/php /etc/php84 |
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
XDEBUG_INI=/etc/php$PHP_INSTALL_VERSION/conf.d/xdebug.ini | ||
|
||
if [ "$XDEBUG_ENABLE" = "true" ]; then | ||
echo "- Start with Xdebug enabled. Remove XDEBUG_ENABLE=true ENV variable to disable it." | ||
if [ -f "$XDEBUG_INI" ]; then | ||
echo "- Already enabled..." | ||
else | ||
mv "$XDEBUG_INI".disabled "$XDEBUG_INI" | ||
touch /tmp/xdebug.log && chmod 666 /tmp/xdebug.log | ||
fi | ||
else | ||
echo "- Start with Xdebug disabled. Add XDEBUG_ENABLE=true ENV variable to enable it." | ||
if [ -f "$XDEBUG_INI" ]; then | ||
mv "$XDEBUG_INI" "$XDEBUG_INI".disabled | ||
else | ||
echo "- Already disabled..." | ||
fi | ||
fi |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.