Commit 7fb54efe authored by Michael Iseard's avatar Michael Iseard
Browse files

Update containers to use PHP 7.4

parent 72487741
# general
HOST=sub.domain.com
ADMINER_HOST=adminer.domain.com
TRAEFIK_ENABLE=true
CONTAINER_PREFIX=myproject
PHP_VERSION=7.4
# wordpress - wordpress:php7.3-fpm
WORDPRESS_VERSION=php7.3-fpm
WORDPRESS_DB_NAME=wordpress
WORDPRESS_TABLE_PREFIX=wp_
WORDPRESS_DB_HOST=mysql
WORDPRESS_DB_USER=root
WORDPRESS_DB_PASSWORD=password
# mariadb - mariadb:latest
MARIADB_VERSION=latest
......
FROM php:7.3-fpm
ARG PHP_VERSION
FROM php:${PHP_VERSION}-fpm
# install the PHP extensions we need
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libxml2-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
libxml2-dev
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) \
gd \
iconv \
......@@ -19,14 +21,9 @@ RUN pecl install redis && docker-php-ext-enable redis
VOLUME /var/www/html
ENV WORDPRESS_VERSION 5.2.2
ENV WORDPRESS_UPSTREAM_VERSION 5.2.2
ENV WORDPRESS_SHA1 3605bcbe9ea48d714efa59b0eb2d251657e7d5b0
COPY docker-entrypoint.sh /entrypoint.sh
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_UPSTREAM_VERSION}.tar.gz \
&& echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c - \
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/latest.tar.gz \
&& tar -xzf wordpress.tar.gz -C /usr/src/ \
&& rm wordpress.tar.gz \
&& chown -R www-data:www-data /usr/src/wordpress
......
version: '3'
networks:
web:
external: true
services:
adminer:
......@@ -13,17 +17,17 @@ services:
- web
- default
labels:
- traefik.enable=true
- traefik.enable=false
- traefik.docker.network=web
- traefik.http.routers.adminer.rule=Host(`${ADMINER_HOST}`)
- traefik.http.routers.adminer.tls.certresolver=cloudflare
- traefik.http.routers.adminer.entrypoints=websecure
- traefik.http.routers.${CONTAINER_PREFIX}-adminer.rule=Host(`${ADMINER_HOST}`)
- traefik.http.routers.${CONTAINER_PREFIX}-adminer.tls.certresolver=cloudflare
- traefik.http.routers.${CONTAINER_PREFIX}-adminer.entrypoints=websecure
yarn:
image: node:10-alpine
container_name: ${CONTAINER_PREFIX}-yarn
volumes:
- ./wordpress/wp-content/themes/diamanttheater/:/app
- ./wordpress/wp-content/themes/:/app
working_dir: /app
command: ["yarn"]
......@@ -31,12 +35,15 @@ services:
image: composer:1.9.0
container_name: ${CONTAINER_PREFIX}-composer
volumes:
- ./wordpress/wp-content/themes/diamanttheater/:/app
- ./wordpress/wp-content/themes/:/app
depends_on:
- wordpress
wordpress:
build: ./build
build:
context: ./build/wordpress
args:
PHP_VERSION: ${PHP_VERSION:-7.3}
container_name: ${CONTAINER_PREFIX}-wordpress
networks:
- default
......@@ -45,11 +52,11 @@ services:
volumes:
- ${WORDPRESS_DIR:-./wordpress}:/var/www/html/
environment:
- WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME:-wordpress}
- WORDPRESS_DB_NAME=${MYSQL_DATABASE:-wordpress}
- WORDPRESS_TABLE_PREFIX=${WORDPRESS_TABLE_PREFIX:-wp_}
- WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST:-mysql}
- WORDPRESS_DB_USER=${WORDPRESS_DB_USER:-root}
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD:-password}
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=${MYSQL_USER:-root}
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD:-password}
restart: always
nginx:
......@@ -67,7 +74,7 @@ services:
- wordpress
restart: always
labels:
- traefik.enable=true
- traefik.enable=${TRAEFIK_ENABLE:-true}
- traefik.docker.network=web
- traefik.http.routers.${CONTAINER_PREFIX}.rule=Host(`${HOST}`)
- traefik.http.routers.${CONTAINER_PREFIX}.tls.certresolver=cloudflare
......@@ -95,7 +102,3 @@ services:
networks:
- default
- web
networks:
web:
external: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment