diff options
author | Tim-Hinnerk Heuer <tim@innocraft.com> | 2021-09-13 05:34:14 +0300 |
---|---|---|
committer | Tim-Hinnerk Heuer <tim@innocraft.com> | 2021-09-13 05:34:14 +0300 |
commit | 2131e91fe319a5e6a6ab49c321942d75e8906147 (patch) | |
tree | 307eacb02499c9a0998a2f9a4293d4665a6b446c | |
parent | 142ecb9076b5db12981ddc60afb6398e6d05f2a2 (diff) |
enable php 8.1-rc, install apache2docker-php8_1
-rw-r--r-- | 000-default.conf | 31 | ||||
-rwxr-xr-x | Dockerfile | 6 | ||||
-rwxr-xr-x | docker-compose.yml | 12 | ||||
-rw-r--r-- | php/Dockerfile | 18 | ||||
-rw-r--r-- | ports.conf | 15 |
5 files changed, 81 insertions, 1 deletions
diff --git a/000-default.conf b/000-default.conf new file mode 100644 index 0000000000..8576a2d405 --- /dev/null +++ b/000-default.conf @@ -0,0 +1,31 @@ +<VirtualHost *:8010> + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf +</VirtualHost> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/Dockerfile b/Dockerfile index b2fe843794..8b601949bc 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,12 @@ RUN apt update && apt install -y nginx php-fpm php-pdo php-pdo-mysql vim-gtk zsh RUN apt install -y php-gd php-xmlwriter php-mbstring php-curl php-zip php-xml RUN apt install -y curl RUN apt install -y mysql-client apg +RUN apt install -y apache2 php libapache2-mod-php +# RUN a2dismod mpm_prefork \ +#RUN apt-get install -y software-properties-common +#RUN add-apt-repository -y ppa:ondrej/php +# RUN apt update && apt install -y php-fpm php-pdo php-pdo-mysql php-gd php-xmlwriter php-mbstring php-curl php-zip php-xml + RUN curl -sS https://getcomposer.org/installer | php RUN chmod +x composer.phar; mv composer.phar /usr/local/bin/composer diff --git a/docker-compose.yml b/docker-compose.yml index 2d67dfb767..9170f27842 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,13 +5,23 @@ services: context: . ports: - 80:80 +# - 8010:8010 volumes: - ./:/var/www/html - ./nginx-default.conf:/etc/nginx/sites-available/default + - ./ports.conf:/etc/apache2/ports.conf + - ./000-default.conf:/etc/apache2/sites-available/000-default.conf environment: - "TZ=Pacific/Auckland" - "USER=1000" - command: "bash -c 'cd /var/www/html; composer install; chown -R www-data:www-data /var/www/html; service php7.4-fpm start; service nginx start; while true; do sleep 3600; done'" + command: "bash -c 'cd /var/www/html; composer install; chown -R www-data:www-data /var/www/html; service php7.4-fpm start; service nginx start; service apache2 start; while true; do sleep 3600; done'" + php: + build: + context: ./php + ports: + - 8010:8010 + volumes: + - ./:/usr/src/myapp mariadb: image: mariadb:10.6 # image: ubuntu:20.04 diff --git a/php/Dockerfile b/php/Dockerfile new file mode 100644 index 0000000000..3ab4827c4d --- /dev/null +++ b/php/Dockerfile @@ -0,0 +1,18 @@ +FROM php:8.1-rc-cli + +ENV TZ=Pacific/Auckland +RUN echo $TZ > /etc/timezone && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime +# RUN apt update && apt install -y nginx php-fpm php-pdo php-pdo-mysql vim-gtk zsh +# RUN apt install -y php-gd php-xmlwriter php-mbstring php-curl php-zip php-xml + +# php-fpm php-pdo php-pdo-mysql php-gd php-xmlwriter php-mbstring php-curl php-zip php-xml +RUN apt update && apt install -y libpng-dev zlib1g-dev libxml2-dev libonig-dev libcurl4-openssl-dev libzip-dev +RUN docker-php-ext-install pdo pdo_mysql +RUN docker-php-ext-install gd +RUN docker-php-ext-install xmlwriter +RUN docker-php-ext-install mbstring +RUN docker-php-ext-install curl +RUN docker-php-ext-install zip xml +WORKDIR /usr/src/myapp + +CMD bash -c 'php -S 0.0.0.0:8010' diff --git a/ports.conf b/ports.conf new file mode 100644 index 0000000000..5cda88598a --- /dev/null +++ b/ports.conf @@ -0,0 +1,15 @@ +# If you just change the port or add more ports here, you will likely also +# have to change the VirtualHost statement in +# /etc/apache2/sites-enabled/000-default.conf + +Listen 8010 + +<IfModule ssl_module> + Listen 443 +</IfModule> + +<IfModule mod_gnutls.c> + Listen 443 +</IfModule> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet |