mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-07 23:17:25 +01:00
Compare commits
23 Commits
v5.11.16-o
...
5.11.52-o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24d1f9cd2e | ||
|
|
9a3603b709 | ||
|
|
c2bf3ca8d9 | ||
|
|
1c3f96e723 | ||
|
|
2364f53777 | ||
|
|
7bfbe9ee03 | ||
|
|
afd597456f | ||
|
|
243f46bd23 | ||
|
|
6dfaa3b441 | ||
|
|
6d0e0648e3 | ||
|
|
85979fdcf2 | ||
|
|
377c068667 | ||
|
|
da7f8d93b0 | ||
|
|
1d475a5218 | ||
|
|
3a8184df73 | ||
|
|
0c796fee5f | ||
|
|
bc5aa2e844 | ||
|
|
295bb6268b | ||
|
|
ff636077d4 | ||
|
|
247f946422 | ||
|
|
4c50bbad19 | ||
|
|
2e22177b20 | ||
|
|
dfc392580e |
4
.github/workflows/build-image-debian.yaml
vendored
4
.github/workflows/build-image-debian.yaml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Build Debian OctaneContainer Image
|
||||
name: Build Debian Octane Container Image
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -12,7 +12,7 @@ on:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
6
.github/workflows/publish-image.yaml
vendored
6
.github/workflows/publish-image.yaml
vendored
@@ -7,16 +7,16 @@ on:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: invoiceninja/invoiceninja-octane
|
||||
context: ./debian
|
||||
context: debian
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4 # Updated from v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
18
debian/Dockerfile
vendored
18
debian/Dockerfile
vendored
@@ -1,13 +1,11 @@
|
||||
FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app
|
||||
|
||||
RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
|
||||
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | \
|
||||
grep -o '"browser_download_url": "[^"]*invoiceninja.tar.gz"' | \
|
||||
cut -d '"' -f 4 | \
|
||||
xargs curl -sL | \
|
||||
tar -xz \
|
||||
tar -xz --strip-components=1 \
|
||||
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
||||
# Set permissions: directories 755, files 644
|
||||
&& chmod -R a=r,u+w,a+X . \
|
||||
# Symlink
|
||||
&& php artisan storage:link \
|
||||
# Octane
|
||||
@@ -69,7 +67,9 @@ RUN install-php-extensions \
|
||||
${php_extra}
|
||||
|
||||
# Configure PHP
|
||||
RUN mv "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini"
|
||||
RUN ln -s "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini"
|
||||
|
||||
COPY php/php.ini /usr/local/etc/php/conf.d/invoiceninja.ini
|
||||
|
||||
# Create directory for artisan tinker (init.sh)
|
||||
RUN mkdir /config/psysh \
|
||||
@@ -80,10 +80,6 @@ RUN chown -R ${user}: \
|
||||
/data/caddy \
|
||||
/config/caddy
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||
|
||||
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
|
||||
|
||||
# InvoiceNinja
|
||||
COPY --from=prepare-app --chown=${user}:${user} /app /app
|
||||
|
||||
@@ -91,3 +87,7 @@ COPY --from=prepare-app --chown=${user}:${user} /app /app
|
||||
COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
||||
|
||||
USER ${user}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||
|
||||
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
|
||||
|
||||
9
debian/docker-compose.yml
vendored
9
debian/docker-compose.yml
vendored
@@ -9,7 +9,6 @@ x-logging: &default-logging
|
||||
x-app-volumes: &volumes
|
||||
volumes:
|
||||
- ./.env:/app/.env
|
||||
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro
|
||||
- app_cache:/var/www/html/bootstrap/cache
|
||||
- app_storage:/app/storage
|
||||
- caddy_data:/data
|
||||
@@ -26,7 +25,7 @@ services:
|
||||
ports:
|
||||
- "80:80" # HTTP
|
||||
# - "443:443" # HTTPS
|
||||
# - "443:443/udp" # HTTP/3, causes an error for pdf preview H3_GENERAL_PROTOCOL_ERROR
|
||||
# - "443:443/udp" # HTTP/3, Works for chromium based browser, but causes H3_GENERAL_PROTOCOL_ERROR for pdf previews in Firefox
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
@@ -59,6 +58,9 @@ services:
|
||||
environment:
|
||||
LARAVEL_ROLE: worker
|
||||
<<: *volumes
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "-f", "queue:work"]
|
||||
start_period: 10s
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
@@ -74,6 +76,9 @@ services:
|
||||
environment:
|
||||
LARAVEL_ROLE: scheduler
|
||||
<<: *volumes
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "-f", "schedule:work"]
|
||||
start_period: 10s
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
12
debian/php/php.ini
vendored
12
debian/php/php.ini
vendored
@@ -6,10 +6,18 @@ upload_max_filesize=10M
|
||||
[opcache]
|
||||
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
|
||||
opcache.enable_cli=1
|
||||
opcache.max_accelerated_files=4000
|
||||
opcache.revalidate_freq=60
|
||||
|
||||
[jit]
|
||||
; https://wiki.php.net/rfc/jit_config_defaults
|
||||
opcache.jit=tracing
|
||||
opcache.jit_buffer_size=64M
|
||||
|
||||
[extra]
|
||||
; https://frankenphp.dev/docs/performance/#php-performance
|
||||
; http://symfony.com/doc/current/performance.html
|
||||
opcache.memory_consumption=256
|
||||
opcache.max_accelerated_files=20000
|
||||
opcache.preload=/app/preload.php
|
||||
opcache.validate_timestamps=0
|
||||
realpath_cache_size = 4096K
|
||||
realpath_cache_ttl = 600
|
||||
|
||||
30
debian/scripts/init.sh
vendored
30
debian/scripts/init.sh
vendored
@@ -6,6 +6,34 @@ role=${LARAVEL_ROLE:-app}
|
||||
# Check for default CMD, flag(s) or empty CMD
|
||||
if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$1" ] || [ "$#" -eq "0" ]; then
|
||||
|
||||
if [ "--help" = "$1" ]; then
|
||||
echo [CMD]
|
||||
echo "This image will execute specific CMDs based on the environment variable LARAVEL_ROLE"
|
||||
echo
|
||||
echo "LARAVEL_ROLE=app: frankenphp php-cli artisan octane:frankenphp (default)"
|
||||
echo "LARAVEL_ROLE=worker: frankenphp php-cli artisan queue:work"
|
||||
echo "LARAVEL_ROLE=scheduler: frankenphp php-cli artisan schedule:work"
|
||||
echo
|
||||
echo [FLAGS]
|
||||
echo To the CMD defined by LARAVEL_ROLE can be extended with flags for artisan commands
|
||||
echo
|
||||
echo Available flags can be displaced:
|
||||
echo docker run --rm invoiceninja/invoiceninja-debian frankenphp php-cli artisan help octane:frankenphp
|
||||
echo docker run --rm invoiceninja/invoiceninja-debian frankenphp php-cli artisan queue:work
|
||||
echo docker run --rm invoiceninja/invoiceninja-debian frankenphp php-cli artisan schedule:work
|
||||
echo
|
||||
echo Example:
|
||||
echo docker run -e LARAVEL_ROLE=worker invoiceninja/invoiceninja-debian --verbose --sleep=3 --tries=3 --max-time=3600
|
||||
echo
|
||||
echo [Deployment]
|
||||
echo Docker compose is recommended
|
||||
echo
|
||||
echo Example:
|
||||
echo https://github.com/invoiceninja/dockerfiles/blob/octane/debian/docker-compose.yml
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run app
|
||||
if [ "${role}" = "app" ]; then
|
||||
cmd="frankenphp php-cli artisan octane:frankenphp"
|
||||
@@ -20,7 +48,7 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
|
||||
frankenphp php-cli artisan migrate --force
|
||||
|
||||
# If first IN run, it needs to be initialized
|
||||
if [ "$(frankenphp php-cli artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
|
||||
if [ "$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
|
||||
echo "Running initialization..."
|
||||
|
||||
frankenphp php-cli artisan db:seed --force
|
||||
|
||||
Reference in New Issue
Block a user