mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-31 11:17:09 +01:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad2a8b35dc | ||
|
|
6f9de01d3b | ||
|
|
fa5d522a36 | ||
|
|
84a42794d3 | ||
|
|
9cd585678c | ||
|
|
8899d3e956 | ||
|
|
f22c7b4f59 | ||
|
|
d728221b0b | ||
|
|
be451b454f | ||
|
|
184564e022 | ||
|
|
2f31fc0da8 | ||
|
|
7a37b9641d | ||
|
|
1917de0046 | ||
|
|
c9f91b4a45 | ||
|
|
0117fbd93e | ||
|
|
fc7b94a223 | ||
|
|
281b6a15a4 | ||
|
|
5e6d21646c | ||
|
|
17c1705fe7 | ||
|
|
9180712245 | ||
|
|
94582c4658 | ||
|
|
3e5035478d | ||
|
|
4e80bc01d0 | ||
|
|
6e73e3af9d | ||
|
|
9944d43f0b | ||
|
|
5eefcecf47 | ||
|
|
f80e7f2ec3 | ||
|
|
f5821630fa | ||
|
|
1848f11a36 | ||
|
|
f96d4d4aa0 | ||
|
|
5d29d3a052 | ||
|
|
0c607953ec | ||
|
|
ebc6c3642a | ||
|
|
ec35498159 | ||
|
|
4bff59808e | ||
|
|
217c05bd1f | ||
|
|
24d1f9cd2e | ||
|
|
9a3603b709 | ||
|
|
c2bf3ca8d9 | ||
|
|
1c3f96e723 | ||
|
|
2364f53777 | ||
|
|
7bfbe9ee03 | ||
|
|
afd597456f | ||
|
|
243f46bd23 | ||
|
|
6dfaa3b441 | ||
|
|
6d0e0648e3 | ||
|
|
85979fdcf2 |
@@ -1,24 +0,0 @@
|
|||||||
# EditorConfig is awesome: https://EditorConfig.org
|
|
||||||
|
|
||||||
# top-most EditorConfig file
|
|
||||||
root = true
|
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
# Matches multiple files with brace expansion notation
|
|
||||||
# Set default charset
|
|
||||||
[*.*]
|
|
||||||
charset = utf-8
|
|
||||||
|
|
||||||
# Tab indentation (no size specified)
|
|
||||||
[Makefile]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
# Matches the files *.yml
|
|
||||||
[*.yml]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
20
.github/workflows/build-image-debian.yaml
vendored
20
.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,15 +12,14 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ startsWith(matrix.platforms, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform: ["linux/amd64", "linux/arm64"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@@ -28,11 +27,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: debian
|
context: debian
|
||||||
file: debian/Dockerfile
|
|
||||||
load: true
|
load: true
|
||||||
tags: invoiceninja/invoiceninja-octane:test
|
tags: invoiceninja/invoiceninja-octane:test
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
24
.github/workflows/publish-image.yaml
vendored
24
.github/workflows/publish-image.yaml
vendored
@@ -7,16 +7,18 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ startsWith(matrix.platforms, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
platform: ["linux/amd64", "linux/arm64"]
|
||||||
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@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -43,33 +45,27 @@ jobs:
|
|||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
|
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3 # Updated from v1
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3 # Updated from v1
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3 # Updated from v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v5 # Updated from v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ${{ matrix.context }}
|
context: ${{ matrix.context }}
|
||||||
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
cache-from: type=gha # Updated cache type
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|||||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,14 +0,0 @@
|
|||||||
# OS files
|
|
||||||
.DS_Store
|
|
||||||
.DS_Store?
|
|
||||||
._*
|
|
||||||
.Spotlight-V100
|
|
||||||
.Trashes
|
|
||||||
ehthumbs.db
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Helm
|
|
||||||
charts/**/charts/
|
|
||||||
|
|
||||||
# Compose filesystem
|
|
||||||
/docker
|
|
||||||
@@ -74,9 +74,8 @@ docker-compose up -d
|
|||||||
To upgrade to a newer release image, update your docker-compose.yml first by running:
|
To upgrade to a newer release image, update your docker-compose.yml first by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose down
|
|
||||||
docker-compose pull
|
docker-compose pull
|
||||||
docker-compose up
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
It is recommended to perform a backup before updating.
|
It is recommended to perform a backup before updating.
|
||||||
|
|||||||
4
debian/.env
vendored
4
debian/.env
vendored
@@ -1,5 +1,5 @@
|
|||||||
# IN application vars
|
# IN application vars
|
||||||
APP_URL=http://localhost:8012
|
APP_URL=http://localhost
|
||||||
APP_KEY=base64:RR++yx2rJ9kdxbdh3+AmbHLDQu+Q76i++co9Y8ybbno=
|
APP_KEY=base64:RR++yx2rJ9kdxbdh3+AmbHLDQu+Q76i++co9Y8ybbno=
|
||||||
APP_ENV=production
|
APP_ENV=production
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
24
debian/Dockerfile
vendored
24
debian/Dockerfile
vendored
@@ -1,10 +1,11 @@
|
|||||||
FROM dunglas/frankenphp:1-php8.3-bookworm AS prepare-app
|
ARG PHP_VERSION=8.4
|
||||||
|
ARG FRANKENPHP_VERSION=1
|
||||||
|
ARG DEBIAN_VERSION=trixie
|
||||||
|
|
||||||
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
|
||||||
@@ -71,6 +72,9 @@ 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
|
COPY php/php.ini /usr/local/etc/php/conf.d/invoiceninja.ini
|
||||||
|
|
||||||
|
# Workaround: Disable SSL for mariadb-client for compatibility with MySQL
|
||||||
|
RUN echo "skip-ssl = true" >> /etc/mysql/mariadb.conf.d/50-client.cnf
|
||||||
|
|
||||||
# Create directory for artisan tinker (init.sh)
|
# Create directory for artisan tinker (init.sh)
|
||||||
RUN mkdir /config/psysh \
|
RUN mkdir /config/psysh \
|
||||||
&& chown ${user}: /config/psysh
|
&& chown ${user}: /config/psysh
|
||||||
@@ -88,6 +92,8 @@ COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
|||||||
|
|
||||||
USER ${user}
|
USER ${user}
|
||||||
|
|
||||||
|
HEALTHCHECK --start-period=100s 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"]
|
||||||
|
|||||||
11
debian/docker-compose.yml
vendored
11
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
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ services:
|
|||||||
app:
|
app:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# php artisan help octane:frankenphp
|
# php artisan help octane:frankenphp
|
||||||
command: --port=80 --workers=2 --log-level=info
|
command: --port=80 --workers=2 --log-level=info
|
||||||
@@ -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
|
||||||
@@ -46,7 +42,7 @@ services:
|
|||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
app-worker:
|
app-worker:
|
||||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# php artisan help queue:work
|
# php artisan help queue:work
|
||||||
command: --verbose --sleep=3 --tries=3 --max-time=3600
|
command: --verbose --sleep=3 --tries=3 --max-time=3600
|
||||||
@@ -67,7 +63,7 @@ services:
|
|||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
|
|
||||||
app-scheduler:
|
app-scheduler:
|
||||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# php artisan help schedule:work
|
# php artisan help schedule:work
|
||||||
command: --verbose
|
command: --verbose
|
||||||
@@ -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:
|
||||||
|
|||||||
42
debian/scripts/init.sh
vendored
42
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,26 +44,32 @@ 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/app/public ] || mkdir -p /var/www/html/storage/app/public
|
||||||
|
[ -d /app/storage/framework/sessions ] || mkdir -p /app/storage/framework/sessions
|
||||||
|
[ -d /app/storage/framework/views ] || mkdir -p /app/storage/framework/views
|
||||||
|
[ -d /app/storage/framework/cache ] || mkdir -p /app/storage/framework/cache
|
||||||
|
[ -d /app/storage/logs ] || mkdir -p /app/storage/logs
|
||||||
|
|
||||||
if [ "$APP_ENV" = "production" ]; then
|
if [ "$APP_ENV" = "production" ]; then
|
||||||
|
frankenphp php-cli artisan migrate --force
|
||||||
|
frankenphp php-cli artisan cache:clear # Clear after the migration
|
||||||
|
frankenphp php-cli artisan ninja:design-update
|
||||||
frankenphp php-cli artisan optimize
|
frankenphp php-cli artisan optimize
|
||||||
fi
|
|
||||||
|
|
||||||
frankenphp php-cli artisan package:discover
|
# 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
|
||||||
|
echo "Running initialization..."
|
||||||
|
|
||||||
# Run migrations (if any)
|
frankenphp php-cli artisan db:seed --force
|
||||||
frankenphp php-cli artisan migrate --force
|
|
||||||
|
|
||||||
# If first IN run, it needs to be initialized
|
if [ -n "${IN_USER_EMAIL}" ] && [ -n "${IN_PASSWORD}" ]; then
|
||||||
if [ "$(php -d opcache.preload='' artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')" = "1" ]; then
|
frankenphp php-cli artisan ninja:create-account --email "${IN_USER_EMAIL}" --password "${IN_PASSWORD}"
|
||||||
echo "Running initialization..."
|
else
|
||||||
|
echo "Initialization failed - Set IN_USER_EMAIL and IN_PASSWORD in .env"
|
||||||
frankenphp php-cli artisan db:seed --force
|
exit 1
|
||||||
|
fi
|
||||||
if [ -n "${IN_USER_EMAIL}" ] && [ -n "${IN_PASSWORD}" ]; then
|
|
||||||
frankenphp php-cli artisan ninja:create-account --email "${IN_USER_EMAIL}" --password "${IN_PASSWORD}"
|
|
||||||
else
|
|
||||||
echo "Initialization failed - Set IN_USER_EMAIL and IN_PASSWORD in .env"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
Reference in New Issue
Block a user