Compare commits

..

11 Commits

Author SHA1 Message Date
David Bomba
ff3b7263f5 Merge pull request #825 from turbo124/master
Force cache:clear on first boot
2025-10-28 06:28:11 +11:00
David Bomba
ba896fcc03 Force cache:clear on first boot 2025-10-28 06:26:49 +11:00
David Bomba
b53ed7c914 Merge pull request #749 from turbo124/master
Add deprecation notice for master branch
2025-04-25 08:23:55 +10:00
David Bomba
e3fd4afb7d Add deprecation notice for master branch 2025-04-25 08:23:28 +10:00
David Bomba
afceccfaf6 Merge pull request #734 from benbrummer/master
github latest url, tar.gz, alpine 3.20
2025-03-19 10:05:22 +11:00
Benjamin Brummer
320cdc961d github latest url, tar.gz, alpine 3.20 2025-03-18 07:25:21 +00:00
David Bomba
7e466b38a3 Merge pull request #715 from invoiceninja/revert-689-master
Revert "Align alpine to debian and octane for maintenance"
2025-01-26 09:47:59 +11:00
David Bomba
c5bb7960c3 Revert "Align alpine to debian and octane for maintenance" 2025-01-26 09:47:24 +11:00
David Bomba
3bf4174cbf Merge pull request #712 from turbo124/master
Fixes for publish-image regression
2025-01-24 15:40:41 +11:00
David Bomba
18550bcf3e Fixes for publish-image regression 2025-01-24 15:40:26 +11:00
David Bomba
83bfb1b22f Fixes for publish-image regression 2025-01-24 15:38:25 +11:00
18 changed files with 205 additions and 192 deletions

View File

@@ -53,6 +53,5 @@ jobs:
- name: Move cache - name: Move cache
run: | run: |
mkdir -p /tmp/.buildx-cache
rm -rf /tmp/.buildx-cache rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache

View File

@@ -1,5 +1,9 @@
name: Publish Debian Container Images name: Publish Container Image
# When its time to do a release do a full cross platform build for all supported
# architectures and push all of them to Docker Hub.
# Only trigger on semver shaped tags.
# Ref: https://github.com/metcalfc/docker-action-examples/blob/main/.github/workflows/release.yml
on: on:
push: push:
tags-ignore: tags-ignore:
@@ -8,22 +12,14 @@ on:
jobs: jobs:
docker: docker:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy:
matrix:
include:
- image: invoiceninja/invoiceninja-octane
context: ./debian
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 # Updated from v2 uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare - name: Prepare
id: prep id: prep
run: | run: |
DOCKER_IMAGE=${{ matrix.image }} DOCKER_IMAGE=invoiceninja/invoiceninja
VERSION=edge VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/} VERSION=${GITHUB_REF#refs/tags/}
@@ -32,44 +28,55 @@ jobs:
MAJOR="$(echo "${VERSION}" | cut -d. -f1)" MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
MINOR="$(echo "${VERSION}" | cut -d. -f2)" MINOR="$(echo "${VERSION}" | cut -d. -f2)"
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}" TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
if [[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
# Debug output TAGS="$TAGS,${DOCKER_IMAGE}:latest"
echo "Current version: ${VERSION}" fi
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")" echo "tags=${TAGS}" >> $GITHUB_OUTPUT
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT # Updated output syntax
echo "version=${VERSION}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT echo "major=${MAJOR}" >> $GITHUB_OUTPUT
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 # Updated from v1 uses: docker/setup-qemu-action@v1
with: with:
platforms: all platforms: all
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v3 # Updated from v1 uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-5-${{ hashFiles('alpine/5/cache_buster') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-5-${{ hashFiles('alpine/5/cache_buster') }}-
- name: Login to DockerHub - name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # Updated from v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }} password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v5 # Updated from v2 uses: docker/build-push-action@v2
with: with:
context: ${{ matrix.context }} builder: ${{ steps.buildx.outputs.name }}
context: ./alpine/${{ steps.prep.outputs.major }}/
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }} build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
target: prod
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }} tags: ${{ steps.prep.outputs.tags }}
cache-from: type=gha # Updated cache type cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=gha,mode=max cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Image digest - name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -1,10 +1,15 @@
![Docker images](https://github.com/invoiceninja/dockerfiles/workflows/Docker%20images/badge.svg)
[![Docker image, latest](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja/latest?label=latest)](https://hub.docker.com/r/invoiceninja/invoiceninja) [![Docker image, latest](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja/latest?label=latest)](https://hub.docker.com/r/invoiceninja/invoiceninja)
[![Docker image, alpine](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja/alpine?label=alpine)](https://hub.docker.com/r/invoiceninja/invoiceninja) [![Docker image, alpine](https://img.shields.io/docker/image-size/invoiceninja/invoiceninja/alpine?label=alpine)](https://hub.docker.com/r/invoiceninja/invoiceninja)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/invoiceninja)](https://artifacthub.io/packages/search?repo=invoiceninja) [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/invoiceninja)](https://artifacthub.io/packages/search?repo=invoiceninja)
[![Publish Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml) [![Publish Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml)
[![Cache v5 Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-v5.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-v5.yaml) [![Cache v5 Image](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-v5.yaml/badge.svg)](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-v5.yaml)
# Deprecation Notice
The master branch is not longer receiving active updates. We will continue to tag new releases whilst compatibility with underlying packages remains, however we will not be updating this image going forward.
Instead, please use the debian branch [here](https://github.com/invoiceninja/dockerfiles/tree/debian) this image is a completely fresh start based on the debian image and allows improved package support.
# Docker for [Invoice Ninja](https://www.invoiceninja.com/) # Docker for [Invoice Ninja](https://www.invoiceninja.com/)
:crown: **Features** :crown: **Features**

View File

@@ -1,60 +1,63 @@
ARG PHP_VERSION=8.3
ARG ALPINE_VERSION=3.20 ARG ALPINE_VERSION=3.20
ARG PHP_VERSION=8.2
ARG BAK_STORAGE_PATH=/var/www/app/docker-backup-storage/ ARG BAK_STORAGE_PATH=/var/www/app/docker-backup-storage/
ARG BAK_PUBLIC_PATH=/var/www/app/docker-backup-public/ ARG BAK_PUBLIC_PATH=/var/www/app/docker-backup-public/
# Get Invoice Ninja and install nodejs packages # Get Invoice Ninja and install nodejs packages
FROM --platform=$BUILDPLATFORM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS nodebuild FROM --platform=$BUILDPLATFORM node:lts-alpine${ALPINE_VERSION} as nodebuild
# Download Invoice Ninja # Download Invoice Ninja
ARG INVOICENINJA_VERSION ARG INVOICENINJA_VERSION
ARG REPOSITORY=invoiceninja/invoiceninja ARG REPOSITORY=invoiceninja/invoiceninja
ARG FILENAME=invoiceninja.tar ARG FILENAME=invoiceninja.tar.gz
RUN mkdir -p /var/www/app RUN set -eux; apk add curl unzip grep
# Extract Invoice Ninja # Extract Invoice Ninja
RUN apk add --no-cache curl \ RUN mkdir -p /var/www/app
&& curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \ RUN curl -sL "https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz" | \
grep -o '"browser_download_url": "[^"]*invoiceninja.tar.gz"' | \ tar -xz -C /var/www/app/
cut -d '"' -f 4 | \
xargs curl -sL | \
tar -xz --strip-components=1 -C /var/www/app/ \
&& apk --purge del curl
RUN mkdir -p /var/www/app/public/logo /var/www/app/storage RUN mkdir -p /var/www/app/public/logo /var/www/app/storage
WORKDIR /var/www/app WORKDIR /var/www/app
# Prepare php image # Prepare php image
FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS phpbuild FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} as phpbuild
LABEL maintainer="David Bomba <turbo124@gmail.com>" LABEL maintainer="David Bomba <turbo124@gmail.com>"
ARG php_require="bcmath gd pdo_mysql zip" # Adding caching_sha2_password.so
ARG php_suggest="exif imagick intl pcntl soap" # With this we get native support for caching_sha2_password
ARG php_extra="opcache" RUN apk add --no-cache mariadb-connector-c
RUN ln -s "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini" RUN 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 /usr/bin/install-php-extensions /usr/local/bin/
# Install chromium # Install chromium
RUN set -eux; \ RUN set -eux; \
apk add --no-cache \ apk add --no-cache \
font-isas-misc \ font-isas-misc \
supervisor \ supervisor \
mariadb-client \ mysql-client \
mariadb-connector-c \
chromium \ chromium \
# font-noto-cjk-extra \
# font-wqy-zenhei \
ttf-freefont \ ttf-freefont \
ttf-dejavu ttf-dejavu
# Install PHP extensions RUN install-php-extensions \
RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \ bcmath \
${php_require} \ exif \
${php_suggest} \ gd \
${php_extra} gmp \
mysqli \
opcache \
pdo_mysql \
zip \
intl \
@composer \
&& rm /usr/local/bin/install-php-extensions
# Copy files # Copy files
COPY rootfs / COPY rootfs /
@@ -82,6 +85,8 @@ ENV BAK_STORAGE_PATH $BAK_STORAGE_PATH
ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH
COPY --from=nodebuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app COPY --from=nodebuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app
RUN rm -rf /var/www/app/ui
USER $UID USER $UID
WORKDIR /var/www/app WORKDIR /var/www/app
@@ -99,7 +104,7 @@ ARG BAK_PUBLIC_PATH
RUN mv /var/www/app/storage $BAK_STORAGE_PATH \ RUN mv /var/www/app/storage $BAK_STORAGE_PATH \
&& mv /var/www/app/public $BAK_PUBLIC_PATH && mv /var/www/app/public $BAK_PUBLIC_PATH
FROM phpbuild AS prod FROM phpbuild as prod
COPY --from=dependencybuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app COPY --from=dependencybuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app

View File

@@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
php artisan db:seed --force php artisan db:seed --force
php artisan cache:clear
# Build up array of arguments... # Build up array of arguments...
if [[ ! -z "${IN_USER_EMAIL}" ]]; then if [[ ! -z "${IN_USER_EMAIL}" ]]; then

View File

@@ -1,36 +1,37 @@
[supervisord] [supervisord]
nodaemon=true nodaemon=true
logfile=/dev/null pidfile=/tmp/supervisord.pid
logfile=/dev/null ; nodaemon will cause logs to go to stdout
logfile_maxbytes=0 logfile_maxbytes=0
loglevel=info
[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
[program:php-fpm] [program:php-fpm]
command=php-fpm
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=php-fpm
[program:scheduler] [program:scheduler]
command=php artisan schedule:work
autorestart=true autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=php artisan schedule:work
[program:queue-worker] [program:queue-worker]
process_name=%(program_name)s_%(process_num)02d process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work --sleep=3 --tries=1 --timeout=3600
autostart=true
autorestart=true autorestart=true
stopasgroup=true
killasgroup=true
numprocs=2
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true redirect_stderr=true
stopwaitsecs=3600 stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
numprocs=2
command=php artisan queue:work --sleep=3 --tries=1 --memory=256 --timeout=3600
[eventlistener:shutdown] [eventlistener:shutdown]
command=shutdown.sh command=shutdown.sh

View File

@@ -30,7 +30,7 @@ php artisan optimize
php artisan package:discover php artisan package:discover
# Check if DB works, if not crash the app. # Check if DB works, if not crash the app.
DB_READY=$(php -d opcache.preload='' artisan tinker --execute='echo app()->call("App\Utils\SystemHealth@dbCheck")["success"];') DB_READY=$(php artisan tinker --execute='echo app()->call("App\Utils\SystemHealth@dbCheck")["success"];')
if [ "$DB_READY" != "1" ]; then if [ "$DB_READY" != "1" ]; then
php artisan migrate:status # Print verbose error php artisan migrate:status # Print verbose error
in_error "Error connecting to DB" in_error "Error connecting to DB"
@@ -39,7 +39,7 @@ fi
php artisan migrate --force php artisan migrate --force
# If first IN run, it needs to be initialized # If first IN run, it needs to be initialized
IN_INIT=$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();') IN_INIT=$(php artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')
if [ "$IN_INIT" == "1" ]; then if [ "$IN_INIT" == "1" ]; then
docker_process_init_files /docker-entrypoint-init.d/* docker_process_init_files /docker-entrypoint-init.d/*
fi fi

View File

@@ -1 +0,0 @@
pm.max_children = 10

View File

@@ -0,0 +1,17 @@
; 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
; 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
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 8M

View File

@@ -1,22 +0,0 @@
[core]
; https://www.php.net/manual/en/ini.core.php
post_max_size=10M
upload_max_filesize=10M
[opcache]
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
opcache.enable_cli=1
[jit]
; https://wiki.php.net/rfc/jit_config_defaults
opcache.jit=tracing
opcache.jit_buffer_size=64M
[extra]
; http://symfony.com/doc/current/performance.html
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.preload=/var/www/app/preload.php
opcache.validate_timestamps=0
realpath_cache_size=4096K
realpath_cache_ttl=600

View File

@@ -0,0 +1,34 @@
server {
listen 80 default_server;
server_name _;
server_tokens off;
client_max_body_size 100M;
root /var/www/app/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~* /storage/.*\.php$ {
return 503;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}

View File

@@ -1,14 +0,0 @@
# https://nginx.org/en/docs/http/ngx_http_core_module.html
client_max_body_size 10M;
client_body_buffer_size 10M;
server_tokens off;
# https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
fastcgi_buffers 32 16K;
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
gzip on;
gzip_comp_level 2;
gzip_min_length 1M;
gzip_proxied any;
gzip_types *;

View File

@@ -1,32 +0,0 @@
# https://laravel.com/docs/master/deployment#nginx
server {
listen 80 default_server;
server_name _;
root /var/www/app/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

18
config/php/php-cli.ini Normal file
View File

@@ -0,0 +1,18 @@
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=256
; 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 = 60M
upload_max_filesize = 50M

View File

@@ -1 +0,0 @@
pm.max_children = 10

View File

@@ -1,22 +1,21 @@
[core] session.auto_start = Off
; https://www.php.net/manual/en/ini.core.php short_open_tag = Off
post_max_size=10M
upload_max_filesize=10M
[opcache] error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
opcache.enable_cli=1
[jit] ; opcache.enable=1
; https://wiki.php.net/rfc/jit_config_defaults ; opcache.preload=/var/www/app/preload.php
opcache.jit=tracing ; opcache.preload_user=www-data
opcache.jit_buffer_size=64M
[extra] ; ; The OPcache shared memory storage size.
; http://symfony.com/doc/current/performance.html ; opcache.max_accelerated_files=300000
opcache.memory_consumption=256 ; opcache.validate_timestamps=1
opcache.max_accelerated_files=20000 ; opcache.revalidate_freq=30
opcache.preload=/var/www/app/preload.php ; opcache.jit_buffer_size=256M
opcache.validate_timestamps=0 ; opcache.jit=1205
realpath_cache_size=4096K ; opcache.memory_consumption=1024M
realpath_cache_ttl=600
post_max_size = 60M
upload_max_filesize = 50M
memory_limit=512M

View File

@@ -1,12 +1,14 @@
version: '3.7'
services: services:
nginx: server:
image: nginx image: nginx
restart: always restart: always
env_file: env env_file: env
volumes: volumes:
# Vhost configuration # Vhost configuration
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com #- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
- ./config/nginx:/etc/nginx/conf.d:ro - ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
- ./docker/app/public:/var/www/app/public:ro - ./docker/app/public:/var/www/app/public:ro
depends_on: depends_on:
- app - app
@@ -15,27 +17,28 @@ services:
ports: ports:
- "80:80" - "80:80"
#- "443:443" #- "443:443"
# extra_hosts: networks:
# - "in5.localhost:192.168.0.124 " #host and ip - invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
app: app:
build: image: invoiceninja/invoiceninja:5
context: ./alpine/5
image: invoiceninja/invoiceninja:${TAG:-5}
env_file: env env_file: env
restart: always restart: always
volumes: volumes:
# - ./config/hosts:/etc/hosts:ro - ./config/hosts:/etc/hosts:ro
- ./docker/app/public:/var/www/app/public:rw,delegated - ./docker/app/public:/var/www/app/public:rw,delegated
- ./docker/app/storage:/var/www/app/storage:rw,delegated - ./docker/app/storage:/var/www/app/storage:rw,delegated
# - ./config/php/php.ini:/usr/local/etc/php/conf.d/invoiceninja.ini - ./config/php/php.ini:/usr/local/etc/php/php.ini
# - ./config/php/php-fpm.conf:/usr/local/etc/php-fpm.d/invoiceninja.conf - ./config/php/php-cli.ini:/usr/local/etc/php/php-cli.ini
depends_on: depends_on:
- db - db
- valkey networks:
# extra_hosts: - invoiceninja
# - "in5.localhost:192.168.0.124 " #host and ip extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
db: db:
image: mysql:8 image: mysql:8
@@ -54,8 +57,10 @@ services:
#- ./config/mysql/backup-script:/etc/cron.daily/daily:ro #- ./config/mysql/backup-script:/etc/cron.daily/daily:ro
#- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro #- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro
#- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro #- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro
# extra_hosts: networks:
# - "in5.localhost:192.168.0.124 " #host and ip - invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
# THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5. # THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
# cron: # cron:
@@ -77,9 +82,6 @@ services:
# networks: # networks:
# - invoiceninja # - invoiceninja
# #
valkey:
image: valkey/valkey:8 networks:
restart: unless-stopped invoiceninja:
healthcheck:
test: [ "CMD", "valkey-cli", "ping" ]
start_period: 10s

7
env
View File

@@ -7,13 +7,8 @@ PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*' TRUSTED_PROXIES='*'
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=valkey QUEUE_CONNECTION=database
REDIS_PASSWORD=null
REDIS_PORT=6379
# DB connection # DB connection
DB_HOST=db DB_HOST=db