mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-27 17:27:12 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f80e7f2ec3 | ||
|
|
f5821630fa | ||
|
|
1848f11a36 | ||
|
|
f96d4d4aa0 | ||
|
|
5d29d3a052 | ||
|
|
0c607953ec | ||
|
|
ebc6c3642a | ||
|
|
ec35498159 | ||
|
|
4bff59808e | ||
|
|
217c05bd1f | ||
|
|
24d1f9cd2e | ||
|
|
9a3603b709 | ||
|
|
c2bf3ca8d9 | ||
|
|
1c3f96e723 | ||
|
|
2364f53777 | ||
|
|
7bfbe9ee03 | ||
|
|
afd597456f | ||
|
|
243f46bd23 | ||
|
|
6dfaa3b441 | ||
|
|
6d0e0648e3 | ||
|
|
85979fdcf2 |
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:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -12,7 +12,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
6
.github/workflows/publish-image.yaml
vendored
6
.github/workflows/publish-image.yaml
vendored
@@ -7,16 +7,16 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- image: invoiceninja/invoiceninja-octane
|
- image: invoiceninja/invoiceninja-octane
|
||||||
context: ./debian
|
context: debian
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4 # Updated from v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
|||||||
2
debian/.env
vendored
2
debian/.env
vendored
@@ -57,6 +57,6 @@ NORDIGEN_SECRET_KEY=
|
|||||||
|
|
||||||
IS_DOCKER=true
|
IS_DOCKER=true
|
||||||
SCOUT_DRIVER=null
|
SCOUT_DRIVER=null
|
||||||
SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
|
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
21
debian/Dockerfile
vendored
21
debian/Dockerfile
vendored
@@ -1,10 +1,11 @@
|
|||||||
FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app
|
ARG PHP_VERSION=8.3
|
||||||
|
ARG FRANKENPHP_VERSION=1
|
||||||
|
ARG DEBIAN_VERSION=bookworm
|
||||||
|
|
||||||
RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
|
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-${DEBIAN_VERSION} AS prepare-app
|
||||||
grep -o '"browser_download_url": "[^"]*invoiceninja.tar.gz"' | \
|
|
||||||
cut -d '"' -f 4 | \
|
RUN curl -sL "https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz" | \
|
||||||
xargs curl -sL | \
|
tar -xz \
|
||||||
tar -xz --strip-components=1 \
|
|
||||||
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
||||||
# Symlink
|
# Symlink
|
||||||
&& php artisan storage:link \
|
&& php artisan storage:link \
|
||||||
@@ -14,13 +15,13 @@ RUN curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/lat
|
|||||||
# ==================
|
# ==================
|
||||||
# InvoiceNinja image
|
# InvoiceNinja image
|
||||||
# ==================
|
# ==================
|
||||||
FROM dunglas/frankenphp:1-php8.3-bookworm
|
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-${DEBIAN_VERSION}
|
||||||
|
|
||||||
ARG user=ninja
|
ARG user=ninja
|
||||||
|
|
||||||
# PHP modules
|
# PHP modules
|
||||||
ARG php_require="bcmath gd pdo_mysql zip"
|
ARG php_require="bcmath gd mbstring pdo_mysql zip"
|
||||||
ARG php_suggest="exif imagick intl pcntl soap saxon-12.5.0"
|
ARG php_suggest="exif imagick intl pcntl saxon soap"
|
||||||
ARG php_extra="opcache"
|
ARG php_extra="opcache"
|
||||||
|
|
||||||
# Create a system user UID/GID=999
|
# Create a system user UID/GID=999
|
||||||
@@ -88,6 +89,8 @@ COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
|||||||
|
|
||||||
USER ${user}
|
USER ${user}
|
||||||
|
|
||||||
|
HEALTHCHECK --start-period=10s CMD curl -f http://localhost/health
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||||
|
|
||||||
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
|
CMD ["frankenphp", "php-cli", "artisan", "octane:frankenphp"]
|
||||||
|
|||||||
5
debian/docker-compose.yml
vendored
5
debian/docker-compose.yml
vendored
@@ -9,7 +9,6 @@ x-logging: &default-logging
|
|||||||
x-app-volumes: &volumes
|
x-app-volumes: &volumes
|
||||||
volumes:
|
volumes:
|
||||||
- ./.env:/app/.env
|
- ./.env:/app/.env
|
||||||
- app_cache:/var/www/html/bootstrap/cache
|
|
||||||
- app_storage:/app/storage
|
- app_storage:/app/storage
|
||||||
- caddy_data:/data
|
- caddy_data:/data
|
||||||
|
|
||||||
@@ -31,9 +30,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
LARAVEL_ROLE: app
|
LARAVEL_ROLE: app
|
||||||
<<: *volumes
|
<<: *volumes
|
||||||
# HEALTHCHECK from frankenphp image
|
|
||||||
healthcheck:
|
|
||||||
start_period: 180s
|
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -143,7 +139,6 @@ services:
|
|||||||
# logging: *default-logging
|
# logging: *default-logging
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
app_cache:
|
|
||||||
app_storage:
|
app_storage:
|
||||||
caddy_data:
|
caddy_data:
|
||||||
mysql_data:
|
mysql_data:
|
||||||
|
|||||||
14
debian/scripts/init.sh
vendored
14
debian/scripts/init.sh
vendored
@@ -3,6 +3,12 @@
|
|||||||
# Fallback to app
|
# Fallback to app
|
||||||
role=${LARAVEL_ROLE:-app}
|
role=${LARAVEL_ROLE:-app}
|
||||||
|
|
||||||
|
# Set PDF generation browser path based on architecture
|
||||||
|
export SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
|
||||||
|
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
|
||||||
|
export SNAPPDF_CHROMIUM_PATH=/usr/bin/chromium
|
||||||
|
fi
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
@@ -38,6 +44,12 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
|
|||||||
if [ "${role}" = "app" ]; then
|
if [ "${role}" = "app" ]; then
|
||||||
cmd="frankenphp php-cli artisan octane:frankenphp"
|
cmd="frankenphp php-cli artisan octane:frankenphp"
|
||||||
|
|
||||||
|
# Check for required folders and create if needed, relevant for bind mounts
|
||||||
|
# It is not possible to chown, as we are not executing this script as root
|
||||||
|
[ -d /var/www/html/storage/framework/sessions ] || mkdir -p /var/www/html/storage/framework/sessions
|
||||||
|
[ -d /var/www/html/storage/framework/views ] || mkdir -p /var/www/html/storage/framework/views
|
||||||
|
[ -d /var/www/html/storage/framework/cache ] || mkdir -p /var/www/html/storage/framework/cache
|
||||||
|
|
||||||
if [ "$APP_ENV" = "production" ]; then
|
if [ "$APP_ENV" = "production" ]; then
|
||||||
frankenphp php-cli artisan optimize
|
frankenphp php-cli artisan optimize
|
||||||
fi
|
fi
|
||||||
@@ -48,7 +60,7 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
|
|||||||
frankenphp php-cli artisan migrate --force
|
frankenphp php-cli artisan migrate --force
|
||||||
|
|
||||||
# If first IN run, it needs to be initialized
|
# If first IN run, it needs to be initialized
|
||||||
if [ "$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
|
if [ "$(frankenphp php-cli artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
|
||||||
echo "Running initialization..."
|
echo "Running initialization..."
|
||||||
|
|
||||||
frankenphp php-cli artisan db:seed --force
|
frankenphp php-cli artisan db:seed --force
|
||||||
|
|||||||
Reference in New Issue
Block a user