Added ENV VAR setting for which port to run, flarum on inside the container. (#45)

pull/48/head
Alexander Skvortsov 2020-02-09 13:55:56 -05:00 committed by GitHub
parent ba5878a341
commit 1c3f239b89
4 changed files with 8 additions and 4 deletions

View File

@ -17,7 +17,8 @@ ENV GID=991 \
FLARUM_TITLE=Docker-Flarum \ FLARUM_TITLE=Docker-Flarum \
DEBUG=false \ DEBUG=false \
LOG_TO_STDOUT=false \ LOG_TO_STDOUT=false \
GITHUB_TOKEN_AUTH=false GITHUB_TOKEN_AUTH=false \
FLARUM_PORT=8888
RUN apk add --no-progress --no-cache \ RUN apk add --no-progress --no-cache \
nginx \ nginx \
@ -25,6 +26,7 @@ RUN apk add --no-progress --no-cache \
su-exec \ su-exec \
curl \ curl \
git \ git \
libcap \
php7 \ php7 \
php7-fileinfo \ php7-fileinfo \
php7-phar \ php7-phar \
@ -57,6 +59,6 @@ RUN apk add --no-progress --no-cache \
COPY rootfs / COPY rootfs /
RUN chmod +x /usr/local/bin/* /services/*/run /services/.s6-svscan/* RUN chmod +x /usr/local/bin/* /services/*/run /services/.s6-svscan/*
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/nginx
VOLUME /flarum/app/extensions /etc/nginx/conf.d VOLUME /flarum/app/extensions /etc/nginx/conf.d
EXPOSE 8888
CMD ["/usr/local/bin/startup"] CMD ["/usr/local/bin/startup"]

View File

@ -25,7 +25,7 @@ Simple forum software for building great communities. https://flarum.org/
### Ports ### Ports
- **8888** - Default: **8888** (configurable)
### Volume ### Volume
@ -47,6 +47,7 @@ Simple forum software for building great communities. https://flarum.org/
| **DB_PASS** | MariaDB database password | **required** | none | **DB_PASS** | MariaDB database password | **required** | none
| **DB_PREF** | Flarum tables prefix | *optional* | none | **DB_PREF** | Flarum tables prefix | *optional* | none
| **DB_PORT** | MariaDB database port | *optional* | 3306 | **DB_PORT** | MariaDB database port | *optional* | 3306
| **FLARUM_PORT** | Port to run Flarum on inside the container | *optional* | 8888
| **UPLOAD_MAX_SIZE** | The maximum size of an uploaded file | *optional* | 50M | **UPLOAD_MAX_SIZE** | The maximum size of an uploaded file | *optional* | 50M
| **PHP_MEMORY_LIMIT** | PHP memory limit | *optional* | 128M | | **PHP_MEMORY_LIMIT** | PHP memory limit | *optional* | 128M |
| **OPCACHE_MEMORY_LIMIT** | OPcache memory size in megabytes | *optional* | 128 | **OPCACHE_MEMORY_LIMIT** | OPcache memory size in megabytes | *optional* | 128

View File

@ -53,7 +53,7 @@ http {
image/svg+xml; image/svg+xml;
server { server {
listen 8888; listen <FLARUM_PORT>;
charset utf-8; charset utf-8;
root /flarum/app/public; root /flarum/app/public;

View File

@ -12,6 +12,7 @@ if [ -z "${FORUM_URL}" ]; then
fi fi
# Set file config for nginx and php # Set file config for nginx and php
sed -i "s/<FLARUM_PORT>/${FLARUM_PORT}/g" /etc/nginx/nginx.conf
sed -i "s/<UPLOAD_MAX_SIZE>/${UPLOAD_MAX_SIZE}/g" /etc/nginx/nginx.conf /etc/php7/php-fpm.conf sed -i "s/<UPLOAD_MAX_SIZE>/${UPLOAD_MAX_SIZE}/g" /etc/nginx/nginx.conf /etc/php7/php-fpm.conf
sed -i "s/<PHP_MEMORY_LIMIT>/${PHP_MEMORY_LIMIT}/g" /etc/php7/php-fpm.conf sed -i "s/<PHP_MEMORY_LIMIT>/${PHP_MEMORY_LIMIT}/g" /etc/php7/php-fpm.conf
sed -i "s/<OPCACHE_MEMORY_LIMIT>/${OPCACHE_MEMORY_LIMIT}/g" /etc/php7/conf.d/00_opcache.ini sed -i "s/<OPCACHE_MEMORY_LIMIT>/${OPCACHE_MEMORY_LIMIT}/g" /etc/php7/conf.d/00_opcache.ini