Compare commits

...

6 Commits

Author SHA1 Message Date
David Bomba
7d4afadbb5 Merge pull request #268 from turbo124/master
Add mysql-client back in
2021-01-26 17:13:07 +11:00
David Bomba
3709355309 Add mysql-client back in 2021-01-26 17:12:52 +11:00
David Bomba
4b63e1f76d Merge pull request #265 from lwj5/php
Added install-php-extensions
2021-01-21 13:55:48 +11:00
Lee Ween Jiann
5118eac0ea Added install-php-extensions 2021-01-20 22:56:32 +08:00
David Bomba
486d38d6e1 Merge pull request #263 from turbo124/master
Remove sys_admin, add application variable
2021-01-19 07:39:15 +11:00
David Bomba
89ae36315d Remove sys_admin, add application variable 2021-01-19 07:38:54 +11:00
6 changed files with 54 additions and 89 deletions

View File

@@ -17,32 +17,21 @@ ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH
WORKDIR /var/www/app
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint \
&& mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
RUN set -eux; \
apk add --no-cache \
gmp-dev \
freetype-dev \
libarchive-tools \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev\
libzip-dev
# Install PHP extensions
# https://hub.docker.com/r/mlocati/php-extension-installer/tags
COPY --from=mlocati/php-extension-installer:1.1.41 /usr/bin/install-php-extensions /usr/local/bin/
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include --with-webp-dir=/usr/include --with-freetype-dir=/usr/include/; \
docker-php-ext-configure zip --with-libzip; \
docker-php-ext-install -j$(nproc) \
iconv \
gd \
gmp \
mbstring \
opcache \
pdo \
pdo_mysql \
zip
RUN install-php-extensions \
gd \
gmp \
opcache \
pdo_mysql \
zip
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
# Separate user
ENV INVOICENINJA_USER=invoiceninja
@@ -58,14 +47,15 @@ RUN addgroup --gid=1500 -S "$INVOICENINJA_USER" && \
addgroup "$INVOICENINJA_USER" www-data; \
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
USER $INVOICENINJA_USER
USER 1500
# Download and install IN
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"
RUN curl -s -o /tmp/ninja.zip -SL https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
&& bsdtar --strip-components=1 -C /var/www/app -xf /tmp/ninja.zip \
&& rm /tmp/ninja.zip \
RUN curl -o /tmp/ninja.zip -L https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
&& unzip -q /tmp/ninja.zip -d /tmp/ \
&& mv /tmp/ninja/* /var/www/app \
&& rm -rf /tmp/ninja* \
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
&& mv /var/www/app/public $BAK_PUBLIC_PATH \
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \

View File

@@ -14,7 +14,7 @@ RUN set -eux; \
curl
# Download Invoice Ninja
RUN curl -o /tmp/ninja.tar.gz -LJ0 https://github.com/invoiceninja/invoiceninja/tarball/v$INVOICENINJA_VERSION \
RUN curl -o /tmp/ninja.tar.gz -L https://github.com/invoiceninja/invoiceninja/tarball/v$INVOICENINJA_VERSION \
&& mkdir -p /var/www/app \
&& tar --strip-components=1 -xf /tmp/ninja.tar.gz -C /var/www/app/ \
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
@@ -45,36 +45,33 @@ WORKDIR /var/www/app
COPY --from=frontend /var/www/app /var/www/app
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint \
&& mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
# Install PHP extensions
# https://hub.docker.com/r/mlocati/php-extension-installer/tags
COPY --from=mlocati/php-extension-installer:1.1.41 /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions \
bcmath \
exif \
gd \
gmp \
mysqli \
opcache \
pdo_mysql \
zip \
@composer
# Install chromium
RUN set -eux; \
apk add --no-cache \
mysql-client \
freetype-dev \
gmp-dev \
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
# oniguruma-dev \
git \
# busybox-suid \
zip \
chromium \
harfbuzz \
ttf-freefont \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
bcmath \
exif \
gd \
gmp \
mysqli \
opcache \
pdo_mysql \
zip
ttf-freefont
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
## Separate user
ARG UID=1500
@@ -91,10 +88,6 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \
&& addgroup "$INVOICENINJA_USER" www-data \
&& chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
USER $UID
RUN /usr/local/bin/composer install --no-dev --quiet

View File

@@ -1,18 +0,0 @@
session.auto_start = Off
short_open_tag = Off
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
opcache.enable_cli=1
opcache.fast_shutdown=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
# http://symfony.com/doc/current/performance.html
realpath_cache_size = 4096K
realpath_cache_ttl = 600
memory_limit = 2G
post_max_size = 6M
upload_max_filesize = 5M

View File

@@ -1,17 +1,17 @@
session.auto_start = Off
short_open_tag = Off
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
opcache.enable_cli=1
opcache.fast_shutdown=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2
opcache.revalidate_freq=60
# http://symfony.com/doc/current/performance.html
realpath_cache_size = 4096K
; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; http://php.net/realpath-cache-ttl
;realpath_cache_ttl = 120
realpath_cache_ttl = 600
post_max_size = 6M
upload_max_filesize = 5M
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 8M

View File

@@ -28,8 +28,6 @@ services:
image: invoiceninja/invoiceninja:5
env_file: env
restart: always
cap_add:
- SYS_ADMIN
volumes:
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
- ./config/hosts:/etc/hosts:ro

4
env
View File

@@ -6,7 +6,9 @@ DB_HOST1=db
DB_USERNAME1=ninja
DB_PASSWORD1=ninja
DB_DATABASE1=ninja
PHANTOMJS_PDF_GENERATION=false
#this is a system variable please do not remove
IS_DOCKER=true
#V4 env vars
DB_STRICT=false