mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-08 07:27:25 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d4afadbb5 | ||
|
|
3709355309 | ||
|
|
4b63e1f76d | ||
|
|
5118eac0ea | ||
|
|
486d38d6e1 | ||
|
|
89ae36315d |
@@ -17,32 +17,21 @@ ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH
|
|||||||
WORKDIR /var/www/app
|
WORKDIR /var/www/app
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
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; \
|
# Install PHP extensions
|
||||||
apk add --no-cache \
|
# https://hub.docker.com/r/mlocati/php-extension-installer/tags
|
||||||
gmp-dev \
|
COPY --from=mlocati/php-extension-installer:1.1.41 /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
freetype-dev \
|
|
||||||
libarchive-tools \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libwebp-dev\
|
|
||||||
libzip-dev
|
|
||||||
|
|
||||||
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/; \
|
RUN install-php-extensions \
|
||||||
docker-php-ext-configure zip --with-libzip; \
|
gd \
|
||||||
docker-php-ext-install -j$(nproc) \
|
gmp \
|
||||||
iconv \
|
opcache \
|
||||||
gd \
|
pdo_mysql \
|
||||||
gmp \
|
zip
|
||||||
mbstring \
|
|
||||||
opcache \
|
|
||||||
pdo \
|
|
||||||
pdo_mysql \
|
|
||||||
zip
|
|
||||||
|
|
||||||
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
|
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
|
||||||
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
|
|
||||||
|
|
||||||
# Separate user
|
# Separate user
|
||||||
ENV INVOICENINJA_USER=invoiceninja
|
ENV INVOICENINJA_USER=invoiceninja
|
||||||
@@ -58,14 +47,15 @@ RUN addgroup --gid=1500 -S "$INVOICENINJA_USER" && \
|
|||||||
addgroup "$INVOICENINJA_USER" www-data; \
|
addgroup "$INVOICENINJA_USER" www-data; \
|
||||||
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
|
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
|
||||||
|
|
||||||
USER $INVOICENINJA_USER
|
USER 1500
|
||||||
|
|
||||||
# Download and install IN
|
# Download and install IN
|
||||||
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"
|
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"
|
||||||
|
|
||||||
RUN curl -s -o /tmp/ninja.zip -SL https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
|
RUN curl -o /tmp/ninja.zip -L https://download.invoiceninja.com/ninja-v${INVOICENINJA_VERSION}.zip \
|
||||||
&& bsdtar --strip-components=1 -C /var/www/app -xf /tmp/ninja.zip \
|
&& unzip -q /tmp/ninja.zip -d /tmp/ \
|
||||||
&& rm /tmp/ninja.zip \
|
&& mv /tmp/ninja/* /var/www/app \
|
||||||
|
&& rm -rf /tmp/ninja* \
|
||||||
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
||||||
&& mv /var/www/app/public $BAK_PUBLIC_PATH \
|
&& mv /var/www/app/public $BAK_PUBLIC_PATH \
|
||||||
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RUN set -eux; \
|
|||||||
curl
|
curl
|
||||||
|
|
||||||
# Download Invoice Ninja
|
# 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 \
|
&& mkdir -p /var/www/app \
|
||||||
&& tar --strip-components=1 -xf /tmp/ninja.tar.gz -C /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 \
|
&& 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 --from=frontend /var/www/app /var/www/app
|
||||||
COPY entrypoint.sh /usr/local/bin/docker-entrypoint
|
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; \
|
RUN set -eux; \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
freetype-dev \
|
|
||||||
gmp-dev \
|
|
||||||
libjpeg-turbo-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libzip-dev \
|
|
||||||
# oniguruma-dev \
|
|
||||||
git \
|
git \
|
||||||
# busybox-suid \
|
|
||||||
zip \
|
|
||||||
chromium \
|
chromium \
|
||||||
harfbuzz \
|
ttf-freefont
|
||||||
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
|
|
||||||
|
|
||||||
COPY ./config/php/php.ini /usr/local/etc/php/php.ini
|
COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini
|
||||||
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
|
|
||||||
|
|
||||||
## Separate user
|
## Separate user
|
||||||
ARG UID=1500
|
ARG UID=1500
|
||||||
@@ -91,10 +88,6 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \
|
|||||||
&& addgroup "$INVOICENINJA_USER" www-data \
|
&& addgroup "$INVOICENINJA_USER" www-data \
|
||||||
&& chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
|
&& 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
|
USER $UID
|
||||||
|
|
||||||
RUN /usr/local/bin/composer install --no-dev --quiet
|
RUN /usr/local/bin/composer install --no-dev --quiet
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
session.auto_start = Off
|
; How often (in seconds) to check file timestamps for changes to the shared
|
||||||
short_open_tag = Off
|
; memory storage allocation. ("1" means validate once per second, but only
|
||||||
|
; once per request. "0" means always validate)
|
||||||
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
|
;opcache.revalidate_freq=2
|
||||||
|
|
||||||
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
|
opcache.revalidate_freq=60
|
||||||
|
|
||||||
# http://symfony.com/doc/current/performance.html
|
# 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
|
realpath_cache_ttl = 600
|
||||||
|
|
||||||
post_max_size = 6M
|
; Maximum allowed size for uploaded files.
|
||||||
upload_max_filesize = 5M
|
; http://php.net/upload-max-filesize
|
||||||
|
upload_max_filesize = 8M
|
||||||
@@ -28,8 +28,6 @@ services:
|
|||||||
image: invoiceninja/invoiceninja:5
|
image: invoiceninja/invoiceninja:5
|
||||||
env_file: env
|
env_file: env
|
||||||
restart: always
|
restart: always
|
||||||
cap_add:
|
|
||||||
- SYS_ADMIN
|
|
||||||
volumes:
|
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!
|
# 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
|
- ./config/hosts:/etc/hosts:ro
|
||||||
|
|||||||
4
env
4
env
@@ -6,7 +6,9 @@ DB_HOST1=db
|
|||||||
DB_USERNAME1=ninja
|
DB_USERNAME1=ninja
|
||||||
DB_PASSWORD1=ninja
|
DB_PASSWORD1=ninja
|
||||||
DB_DATABASE1=ninja
|
DB_DATABASE1=ninja
|
||||||
PHANTOMJS_PDF_GENERATION=false
|
|
||||||
|
#this is a system variable please do not remove
|
||||||
|
IS_DOCKER=true
|
||||||
|
|
||||||
#V4 env vars
|
#V4 env vars
|
||||||
DB_STRICT=false
|
DB_STRICT=false
|
||||||
|
|||||||
Reference in New Issue
Block a user