Compare commits

...

36 Commits

Author SHA1 Message Date
David Bomba
e4b3e0f0f1 Merge pull request #711 from turbo124/master
Revert and run on ubuntu 22.04
2025-01-24 15:01:20 +11:00
David Bomba
a060c70d3f Revert and run on ubuntu 22.04 2025-01-24 15:01:08 +11:00
David Bomba
d8749fa049 Revert and run on ubuntu 22.04 2025-01-24 14:59:52 +11:00
David Bomba
febb70263c Merge pull request #710 from turbo124/master
align build and publish images
2025-01-24 14:49:21 +11:00
David Bomba
4b6b287906 align build and publish images 2025-01-24 14:48:52 +11:00
David Bomba
e0bb394346 minor changes 2025-01-24 14:32:47 +11:00
David Bomba
914bebebf6 Merge pull request #705 from turbo124/master
Working on php extension installer issue
2025-01-24 12:20:23 +11:00
David Bomba
e617f2d808 Working on php extension installer issue 2025-01-24 12:19:56 +11:00
David Bomba
3a4f138f6a Merge pull request #704 from turbo124/master
Fixes for yaml syntax
2025-01-24 11:51:00 +11:00
David Bomba
ce9ce4fd26 Fixes for yaml syntax 2025-01-24 11:50:35 +11:00
David Bomba
d01706a734 Merge pull request #703 from turbo124/master
Change the way we invoke install php extensions
2025-01-24 11:49:34 +11:00
David Bomba
00e54c9c23 Change the way we invoke install php extensions 2025-01-24 11:41:37 +11:00
David Bomba
4ea7218cd8 Merge pull request #702 from turbo124/master
Reduce parallel jobs and add swap in case we are hitting github actions
2025-01-24 10:10:16 +11:00
David Bomba
e161a85133 Reduce parallel jobs and add swap in case we are hitting github action limitations 2025-01-24 10:09:25 +11:00
David Bomba
d27c1a22d8 Merge pull request #701 from turbo124/master
Require mbstring
2025-01-24 09:24:18 +11:00
David Bomba
83dbf94c2b require mbstring 2025-01-24 09:22:01 +11:00
David Bomba
c0ee1a5521 Merge pull request #689 from benbrummer/master
Align alpine to debian and octane for maintenance
2025-01-24 09:16:34 +11:00
Benjamin Brummer
018e0e7b2a readded mariadb-connector-c 2025-01-15 11:29:46 +00:00
Benjamin Brummer
07a211bc13 pidfile is not required 2025-01-15 11:16:45 +00:00
Benjamin Brummer
4c9ae7e92f Align supervisor with debian 2025-01-15 11:09:04 +00:00
Benjamin Brummer
fe1ff5c496 remove hosts 2025-01-15 09:53:08 +00:00
Benjamin Brummer
3a0d184fb2 remove network 2025-01-15 09:52:00 +00:00
Benjamin Brummer
42c62adf1a php optimization 2025-01-15 09:49:58 +00:00
Benjamin Brummer
7a72c2ef16 set alpine to 3.20 2025-01-15 09:29:59 +00:00
Benjamin Brummer
974df2fa20 align supervisord to laravel docs/debian 2025-01-14 20:27:22 +00:00
Benjamin Brummer
7629f51492 cleanup php.ini 2025-01-14 20:25:50 +00:00
Benjamin Brummer
977e2001f0 disable preload for artisan tinker 2025-01-13 12:19:01 +00:00
Benjamin Brummer
a520f32385 cleanup 2025-01-13 12:16:43 +00:00
Benjamin Brummer
9b63fc3fbc php-fpm.conf, renamed server to nginx 2025-01-12 14:03:31 +00:00
Benjamin Brummer
cbaf961012 update php.ini, fix for valkey configuration 2025-01-12 12:27:20 +00:00
Benjamin Brummer
797aa6bdf8 redis/valkey cache 2025-01-12 11:43:08 +00:00
Benjamin Brummer
103b912467 align nginx with debian 2025-01-12 11:12:38 +00:00
Benjamin Brummer
7a171b96c7 align with debian, php 8.3 2025-01-12 10:46:52 +00:00
David Bomba
c69093a265 Merge pull request #674 from turbo124/master
Updates for github actions
2024-12-11 09:56:08 +11:00
David Bomba
8863ed9e38 Updates for github actions 2024-12-11 09:54:48 +11:00
David Bomba
76b5e10318 Update README.md 2024-11-23 14:18:12 +11:00
19 changed files with 204 additions and 212 deletions

View File

@@ -31,7 +31,7 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-4-${{ hashFiles('alpine/5/cache_buster') }}-${{ github.sha }}

View File

@@ -16,7 +16,7 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -31,7 +31,7 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-5-${{ hashFiles('alpine/5/cache_buster') }}-${{ github.sha }}
@@ -53,5 +53,6 @@ jobs:
- name: Move cache
run: |
mkdir -p /tmp/.buildx-cache
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

View File

@@ -1,9 +1,5 @@
name: Publish Container Image
name: Publish Debian Container Images
# 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:
push:
tags-ignore:
@@ -11,15 +7,23 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- image: invoiceninja/invoiceninja-octane
context: ./debian
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4 # Updated from v2
with:
fetch-depth: 0
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=invoiceninja/invoiceninja
DOCKER_IMAGE=${{ matrix.image }}
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
@@ -28,55 +32,44 @@ jobs:
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
if [[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=major::${MAJOR}
# Debug output
echo "Current version: ${VERSION}"
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT # Updated output syntax
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3 # Updated from v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('alpine/${{ steps.prep.outputs.major }}/cache_buster') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('alpine/${{ steps.prep.outputs.major }}/cache_buster') }}-
uses: docker/setup-buildx-action@v3 # Updated from v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3 # Updated from v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5 # Updated from v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./alpine/${{ steps.prep.outputs.major }}/
context: ${{ matrix.context }}
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
target: prod
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
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
cache-from: type=gha # Updated cache type
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -12,7 +12,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -55,7 +55,7 @@ jobs:
- "1.23.15"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

View File

@@ -2,7 +2,8 @@
[![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)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/invoiceninja)](https://artifacthub.io/packages/search?repo=invoiceninja)
[![Pusblish 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)
[![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)
# Docker for [Invoice Ninja](https://www.invoiceninja.com/)

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,17 +0,0 @@
; 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

@@ -0,0 +1,22 @@
[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

@@ -1,34 +0,0 @@
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

@@ -0,0 +1,14 @@
# 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 *;

32
config/nginx/laravel.conf Normal file
View File

@@ -0,0 +1,32 @@
# 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;
}
}

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=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

1
config/php/php-fpm.conf Normal file
View File

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

View File

@@ -1,21 +1,22 @@
session.auto_start = Off
short_open_tag = Off
[core]
; https://www.php.net/manual/en/ini.core.php
post_max_size=10M
upload_max_filesize=10M
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
[opcache]
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
opcache.enable_cli=1
; opcache.enable=1
; opcache.preload=/var/www/app/preload.php
; opcache.preload_user=www-data
[jit]
; https://wiki.php.net/rfc/jit_config_defaults
opcache.jit=tracing
opcache.jit_buffer_size=64M
; ; The OPcache shared memory storage size.
; opcache.max_accelerated_files=300000
; opcache.validate_timestamps=1
; opcache.revalidate_freq=30
; opcache.jit_buffer_size=256M
; opcache.jit=1205
; opcache.memory_consumption=1024M
post_max_size = 60M
upload_max_filesize = 50M
memory_limit=512M
[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

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

7
env
View File

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