Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
geekwright committed Nov 11, 2018
1 parent 562e735 commit 9253bcc
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
77 changes: 77 additions & 0 deletions Dockerfile
@@ -0,0 +1,77 @@
# https://www.xoops.org/
FROM php:7.3-rc-apache

# install the PHP extensions we need
RUN set -ex; \
\
if command -v a2enmod; then \
a2enmod rewrite; \
fi; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libjpeg-dev \
libpng-dev \
libpq-dev \
libzip-dev \
zlib1g-dev libicu-dev \
; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
pdo_mysql \
pdo_pgsql \
zip \
intl \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://github.com/XOOPS/XoopsCore25/releases
# ENV XOOPS_VERSION v2.5.9
ENV XOOPS_VERSION mysql8

RUN apt-get update \
&& apt-get install -y git wget unzip libpng-dev libjpeg-progs libvpx-dev \
&& docker-php-ext-install mysqli gd exif \
&& apt-get clean all \
&& git clone --branch ${XOOPS_VERSION} --depth 1 https://github.com/geekwright/XoopsCore25.git \
&& mv XoopsCore25/htdocs/* . \
&& rm -rf XoopsCore25 \
&& chown -R www-data:www-data . \
&& chmod -R 755 /var/www/html \
&& mv /var/www/html/xoops_lib /var/www/ \
&& mv /var/www/html/xoops_data /var/www/ \
&& chmod -R 755 /var/www/xoops_data

EXPOSE 80 443
CMD ["apache2-foreground"]
21 changes: 21 additions & 0 deletions README.md
@@ -0,0 +1,21 @@
# XoopsCore25 via Docker for testing

Features
- geekwright/XoopsCore25 mysql8
- Apache
- PHP 7.3 RC5
- MySQL 8.0

```
docker build -t xoopstest .
docker-compose up
```

Apache is exposed on localhost:8080
phpMyAdmin is available on localhost:8181

When installing XOOPS using this image, in the Database setup use these values:
- hostname "db" (not localhost)
- user "admin"
- password "password"
- database "xoops"
33 changes: 33 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,33 @@
version: "3"
services:
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: xoops
MYSQL_USER: admin
MYSQL_PASSWORD: password
MYSQL_ALLOW_EMPTY_PASSWORD: 1
HOST: mysql
ports:
- 3336:3306
xoops:
image: xoopstest
restart: always
ports:
- "8080:80"
depends_on:
- db
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- '8181:80'
environment:
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_PASSWORD: 'password'
MYSQL_USER: 'admin'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
depends_on:
- db

0 comments on commit 9253bcc

Please sign in to comment.