feat(): update Dockerfile

pull/45/head
Magicalex 2019-11-27 03:42:51 +01:00
parent ac562f51d1
commit c5310da92a
No known key found for this signature in database
GPG Key ID: A89B48B1788C3CB5
9 changed files with 27 additions and 49 deletions

View File

@ -12,8 +12,5 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[*.{diff,md}] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.php]
indent_size = 4

View File

@ -11,41 +11,16 @@ ENV GID=991 \
PHP_MEMORY_LIMIT=128M \ PHP_MEMORY_LIMIT=128M \
OPCACHE_MEMORY_LIMIT=128 OPCACHE_MEMORY_LIMIT=128
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/v3.10/community" >> /etc/apk/repositories \ RUN apk add --update-cache nginx s6 su-exec curl git php7 php7-fileinfo php7-phar php7-fpm php7-curl \
&& apk add -U \ php7-mbstring php7-openssl php7-json php7-pdo php7-pdo_mysql php7-mysqlnd php7-zlib php7-gd php7-dom \
nginx \ php7-ctype php7-session php7-opcache php7-xmlwriter php7-tokenizer php7-zip php7-intl \
s6 \
su-exec \
curl \
git \
php7@community \
php7-fileinfo@community \
php7-phar@community \
php7-fpm@community \
php7-curl@community \
php7-mbstring@community \
php7-openssl@community \
php7-json@community \
php7-pdo@community \
php7-pdo_mysql@community \
php7-mysqlnd@community \
php7-zlib@community \
php7-gd@community \
php7-dom@community \
php7-ctype@community \
php7-session@community \
php7-opcache@community \
php7-xmlwriter@community \
php7-tokenizer@community \
php7-zip@community \
php7-intl@community \
&& cd /tmp \ && cd /tmp \
&& curl -s http://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ && curl -s http://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& chmod +x /usr/local/bin/composer \ && chmod +x /usr/local/bin/composer \
&& composer global require hirak/prestissimo \ && composer global require --no-progress --no-suggest -- hirak/prestissimo \
&& mkdir -p /flarum/app \ && mkdir -p /flarum/app \
&& chown -R $UID:$GID /flarum \ && chown -R $UID:$GID /flarum \
&& COMPOSER_CACHE_DIR="/tmp" su-exec $UID:$GID composer create-project flarum/flarum /flarum/app $VERSION --stability=beta \ && COMPOSER_CACHE_DIR="/tmp" su-exec $UID:$GID composer create-project --stability=beta --no-progress -- flarum/flarum /flarum/app $VERSION \
&& composer clear-cache \ && composer clear-cache \
&& rm -rf /flarum/.composer /var/cache/apk/* && rm -rf /flarum/.composer /var/cache/apk/*

View File

@ -2,6 +2,11 @@
![logo](https://i.imgur.com/Bjrtbsc.png "logo") ![logo](https://i.imgur.com/Bjrtbsc.png "logo")
[![](https://img.shields.io/docker/cloud/build/mondedie/docker-flarum)](https://hub.docker.com/r/mondedie/docker-flarum/builds)
[![](https://img.shields.io/docker/cloud/automated/mondedie/docker-flarum)](https://hub.docker.com/r/mondedie/docker-flarum/builds)
[![](https://img.shields.io/docker/pulls/mondedie/docker-flarum)](https://hub.docker.com/r/mondedie/docker-flarum)
[![](https://img.shields.io/docker/stars/mondedie/docker-flarum)](https://hub.docker.com/r/mondedie/docker-flarum)
### What is this ? ### What is this ?
Simple forum software for building great communities. https://flarum.org/ Simple forum software for building great communities. https://flarum.org/

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/usr/bin/env sh
exit 0 exit 0

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/usr/bin/env sh
exec nginx exec nginx

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/usr/bin/env sh
exec php-fpm7 exec php-fpm7

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env sh
# COMPOSER WRAPUP SCRIPT # COMPOSER WRAPUP SCRIPT
# This script allow to add new extensions to flarum # This script allow to add new extensions to flarum

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env sh
# Default values # Default values
DB_HOST="${DB_HOST:-mariadb}" DB_HOST="${DB_HOST:-mariadb}"
@ -64,7 +64,7 @@ if [ ! -e '/etc/nginx/conf.d/custom-vhost-flarum.conf' ]; then
# }' > /etc/nginx/conf.d/custom-vhost-flarum.conf # }' > /etc/nginx/conf.d/custom-vhost-flarum.conf
fi fi
# if no installation was performed before # if installation was performed before
if [ -e '/flarum/app/public/assets/rev-manifest.json' ]; then if [ -e '/flarum/app/public/assets/rev-manifest.json' ]; then
echo "[INFO] Flarum already installed, init app..." echo "[INFO] Flarum already installed, init app..."
@ -74,8 +74,9 @@ if [ -e '/flarum/app/public/assets/rev-manifest.json' ]; then
-e "s|<DB_USER>|${DB_USER}|g" \ -e "s|<DB_USER>|${DB_USER}|g" \
-e "s|<DB_PASS>|${DB_PASS}|g" \ -e "s|<DB_PASS>|${DB_PASS}|g" \
-e "s|<DB_PREF>|${DB_PREF}|g" \ -e "s|<DB_PREF>|${DB_PREF}|g" \
-e "s|<FORUM_URL>|${FORUM_URL}|g" /flarum/app/config.php -e "s|<FORUM_URL>|${FORUM_URL}|g" /flarum/app/config.php.sample
cp /flarum/app/config.php.sample /flarum/app/config.php
su-exec $UID:$GID php /flarum/app/flarum cache:clear su-exec $UID:$GID php /flarum/app/flarum cache:clear
# Composer cache dir and packages list paths # Composer cache dir and packages list paths
@ -97,8 +98,8 @@ if [ -e '/flarum/app/public/assets/rev-manifest.json' ]; then
echo "[INFO] Init done, launch flarum..." echo "[INFO] Init done, launch flarum..."
else else
# if no installation was performed before
echo "[INFO] First launch, installation..." echo "[INFO] First launch, installation..."
rm -rf /flarum/app/config.php
if [ -z "${FLARUM_ADMIN_USER}" ] || [ -z "${FLARUM_ADMIN_PASS}" ] || [ -z "${FLARUM_ADMIN_MAIL}" ]; then if [ -z "${FLARUM_ADMIN_USER}" ] || [ -z "${FLARUM_ADMIN_PASS}" ] || [ -z "${FLARUM_ADMIN_MAIL}" ]; then
echo "[ERROR] User admin info of flarum must be set !" echo "[ERROR] User admin info of flarum must be set !"