mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-02-02 04:07:10 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc5aa2e844 | ||
|
|
295bb6268b | ||
|
|
ff636077d4 | ||
|
|
247f946422 | ||
|
|
4c50bbad19 | ||
|
|
2e22177b20 | ||
|
|
dfc392580e | ||
|
|
260980f2a3 | ||
|
|
57724b7d93 | ||
|
|
39b6680f0b |
21
debian/Dockerfile
vendored
21
debian/Dockerfile
vendored
@@ -4,17 +4,12 @@ RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/lat
|
|||||||
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | \
|
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | \
|
||||||
cut -d '"' -f 4 | \
|
cut -d '"' -f 4 | \
|
||||||
xargs curl -sL | \
|
xargs curl -sL | \
|
||||||
tar -xz
|
tar -xz \
|
||||||
|
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
||||||
RUN ln -s ./resources/views/react/index.blade.php ./public/index.html
|
# Symlink
|
||||||
|
&& php artisan storage:link \
|
||||||
# Set permissions: directories 755, files 644
|
# Octane
|
||||||
RUN chmod -R a=r,u+w,a+X .
|
&& php artisan octane:install --server=frankenphp
|
||||||
|
|
||||||
RUN php artisan storage:link
|
|
||||||
|
|
||||||
# Octane
|
|
||||||
RUN php artisan octane:install --server=frankenphp
|
|
||||||
|
|
||||||
# ==================
|
# ==================
|
||||||
# InvoiceNinja image
|
# InvoiceNinja image
|
||||||
@@ -72,7 +67,9 @@ RUN install-php-extensions \
|
|||||||
${php_extra}
|
${php_extra}
|
||||||
|
|
||||||
# Configure PHP
|
# 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)
|
# Create directory for artisan tinker (init.sh)
|
||||||
RUN mkdir /config/psysh \
|
RUN mkdir /config/psysh \
|
||||||
|
|||||||
22
debian/docker-compose.yml
vendored
22
debian/docker-compose.yml
vendored
@@ -9,9 +9,9 @@ x-logging: &default-logging
|
|||||||
x-app-volumes: &volumes
|
x-app-volumes: &volumes
|
||||||
volumes:
|
volumes:
|
||||||
- ./.env:/app/.env
|
- ./.env:/app/.env
|
||||||
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro
|
|
||||||
- app_cache:/var/www/html/bootstrap/cache
|
- app_cache:/var/www/html/bootstrap/cache
|
||||||
- app_storage:/app/storage
|
- app_storage:/app/storage
|
||||||
|
- caddy_data:/data
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
@@ -20,9 +20,12 @@ services:
|
|||||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# php artisan help octane:frankenphp
|
# 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:
|
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_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
environment:
|
environment:
|
||||||
@@ -55,6 +58,9 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
LARAVEL_ROLE: worker
|
LARAVEL_ROLE: worker
|
||||||
<<: *volumes
|
<<: *volumes
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pgrep", "-f", "queue:work"]
|
||||||
|
start_period: 10s
|
||||||
depends_on:
|
depends_on:
|
||||||
app:
|
app:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -70,6 +76,9 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
LARAVEL_ROLE: scheduler
|
LARAVEL_ROLE: scheduler
|
||||||
<<: *volumes
|
<<: *volumes
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pgrep", "-f", "schedule:work"]
|
||||||
|
start_period: 10s
|
||||||
depends_on:
|
depends_on:
|
||||||
app:
|
app:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -135,14 +144,9 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
app_cache:
|
app_cache:
|
||||||
driver: local
|
|
||||||
app_storage:
|
app_storage:
|
||||||
driver: local
|
caddy_data:
|
||||||
mysql_data:
|
mysql_data:
|
||||||
driver: local
|
|
||||||
redis_data:
|
redis_data:
|
||||||
driver: local
|
|
||||||
# mariadb:
|
# mariadb:
|
||||||
# driver: local
|
|
||||||
# valkey:
|
# valkey:
|
||||||
# driver: local
|
|
||||||
|
|||||||
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
|
# Check for default CMD, flag(s) or empty CMD
|
||||||
if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$1" ] || [ "$#" -eq "0" ]; then
|
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
|
# Run app
|
||||||
if [ "${role}" = "app" ]; then
|
if [ "${role}" = "app" ]; then
|
||||||
cmd="frankenphp php-cli artisan octane:frankenphp"
|
cmd="frankenphp php-cli artisan octane:frankenphp"
|
||||||
|
|||||||
Reference in New Issue
Block a user