mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-07 15:07:27 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc5aa2e844 | ||
|
|
295bb6268b | ||
|
|
ff636077d4 | ||
|
|
247f946422 | ||
|
|
4c50bbad19 | ||
|
|
2e22177b20 | ||
|
|
dfc392580e | ||
|
|
260980f2a3 | ||
|
|
57724b7d93 | ||
|
|
39b6680f0b | ||
|
|
768df3c1dd | ||
|
|
7870b345ed | ||
|
|
3c6ed5cda1 | ||
|
|
2f43d4b45a |
32
debian/Dockerfile
vendored
32
debian/Dockerfile
vendored
@@ -1,27 +1,15 @@
|
||||
FROM composer:latest AS composer
|
||||
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"' | \
|
||||
cut -d '"' -f 4 | \
|
||||
xargs curl -sL | \
|
||||
tar -xz
|
||||
|
||||
RUN ln -s ./resources/views/react/index.blade.php ./public/index.html
|
||||
|
||||
# Set permissions: directories 755, files 644
|
||||
RUN chmod -R a=r,u+w,a+X .
|
||||
|
||||
# Install dependencies
|
||||
RUN composer install --no-dev --no-scripts --no-autoloader --ignore-platform-reqs
|
||||
|
||||
RUN composer require laravel/octane --ignore-platform-reqs
|
||||
|
||||
RUN composer dump-autoload --optimize
|
||||
|
||||
RUN php artisan storage:link
|
||||
|
||||
# Octane
|
||||
RUN php artisan octane:install --server=frankenphp
|
||||
tar -xz \
|
||||
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
||||
# Symlink
|
||||
&& php artisan storage:link \
|
||||
# Octane
|
||||
&& php artisan octane:install --server=frankenphp
|
||||
|
||||
# ==================
|
||||
# InvoiceNinja image
|
||||
@@ -79,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 \
|
||||
@@ -95,7 +85,7 @@ ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
|
||||
|
||||
# InvoiceNinja
|
||||
COPY --from=composer --chown=${user}:${user} /app /app
|
||||
COPY --from=prepare-app --chown=${user}:${user} /app /app
|
||||
|
||||
# Add initialization script
|
||||
COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
||||
|
||||
22
debian/docker-compose.yml
vendored
22
debian/docker-compose.yml
vendored
@@ -9,9 +9,9 @@ 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
|
||||
|
||||
services:
|
||||
app:
|
||||
@@ -20,9 +20,12 @@ services:
|
||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
||||
restart: unless-stopped
|
||||
# php artisan help octane:frankenphp
|
||||
command: --log-level=info
|
||||
command: --port=80 --workers=2 --log-level=info
|
||||
# command: --host=example.com --port=443 --workers=2 --https --http-redirect --log-level=info
|
||||
ports:
|
||||
- "80:8000"
|
||||
- "80:80" # HTTP
|
||||
# - "443:443" # HTTPS
|
||||
# - "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:
|
||||
@@ -55,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
|
||||
@@ -70,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
|
||||
@@ -135,14 +144,9 @@ services:
|
||||
|
||||
volumes:
|
||||
app_cache:
|
||||
driver: local
|
||||
app_storage:
|
||||
driver: local
|
||||
caddy_data:
|
||||
mysql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
# mariadb:
|
||||
# driver: local
|
||||
# valkey:
|
||||
# driver: local
|
||||
|
||||
10
debian/php/php.ini
vendored
10
debian/php/php.ini
vendored
@@ -1,15 +1,15 @@
|
||||
[core]
|
||||
# https://www.php.net/manual/en/ini.core.php
|
||||
post_max_size = 10M
|
||||
upload_max_filesize = 10M
|
||||
; 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
|
||||
; 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
|
||||
; https://wiki.php.net/rfc/jit_config_defaults
|
||||
opcache.jit=tracing
|
||||
opcache.jit_buffer_size=64M
|
||||
|
||||
28
debian/scripts/init.sh
vendored
28
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"
|
||||
|
||||
Reference in New Issue
Block a user