mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-03 21:17:27 +01:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f79afe3dcf | ||
|
|
720d17aac0 | ||
|
|
8d53a0d915 | ||
|
|
a29e6f3d18 | ||
|
|
48fd2fdf9d | ||
|
|
97c2a4cf27 | ||
|
|
026d00dea0 | ||
|
|
7848cf055a | ||
|
|
5434c1e6da | ||
|
|
de60faec4d | ||
|
|
41c0b26efb | ||
|
|
670eb2ce33 | ||
|
|
ea35d304df | ||
|
|
64382d89ad | ||
|
|
7dfe1dadc1 | ||
|
|
7d518c24dc | ||
|
|
a4289dffa3 | ||
|
|
54e5031703 | ||
|
|
7eee4e770e | ||
|
|
cc2cc537b5 | ||
|
|
5361a2dabf | ||
|
|
de1a30979d | ||
|
|
26aa6b45c1 | ||
|
|
4de9066b39 | ||
|
|
65fbd0bd5d | ||
|
|
eecea97f7c | ||
|
|
ad2a8b35dc | ||
|
|
6f9de01d3b | ||
|
|
fa5d522a36 | ||
|
|
84a42794d3 | ||
|
|
9cd585678c | ||
|
|
8899d3e956 | ||
|
|
f22c7b4f59 | ||
|
|
d728221b0b | ||
|
|
be451b454f | ||
|
|
184564e022 | ||
|
|
2f31fc0da8 | ||
|
|
7a37b9641d | ||
|
|
1917de0046 | ||
|
|
c9f91b4a45 | ||
|
|
0117fbd93e | ||
|
|
fc7b94a223 | ||
|
|
281b6a15a4 |
@@ -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
|
||||
|
||||
38
.github/workflows/build-image-debian.yaml
vendored
38
.github/workflows/build-image-debian.yaml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Build Debian Octane Container Image
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "debian/**"
|
||||
push:
|
||||
paths:
|
||||
- "debian/**"
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: debian
|
||||
file: debian/Dockerfile
|
||||
load: true
|
||||
tags: invoiceninja/invoiceninja-octane:test
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
48
.github/workflows/build-image-octane.yaml
vendored
Normal file
48
.github/workflows/build-image-octane.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Build Octane Container Image
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/**"
|
||||
- "octane/**"
|
||||
push:
|
||||
paths:
|
||||
- ".github/**"
|
||||
- "octane/**"
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: invoiceninja/invoiceninja-octane
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: octane
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ env.REGISTRY_IMAGE }}
|
||||
outputs: type=image,push-by-digest=true,name-canonical=true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
166
.github/workflows/publish-image-octane.yaml
vendored
Normal file
166
.github/workflows/publish-image-octane.yaml
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
name: Publish Octane Container Images
|
||||
|
||||
on:
|
||||
push:
|
||||
tags-ignore:
|
||||
- "invoiceninja-*"
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: invoiceninja/invoiceninja-octane
|
||||
|
||||
jobs:
|
||||
version:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
major: ${{ steps.version.outputs.major }}
|
||||
minor: ${{ steps.version.outputs.minor }}
|
||||
url: ${{ steps.version.outputs.url }}
|
||||
steps:
|
||||
- id: version
|
||||
run: |
|
||||
|
||||
VERSION=edge
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
# Remove -o or -d suffix if present
|
||||
VERSION=${VERSION%-*}
|
||||
fi
|
||||
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
||||
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
||||
URL=https://github.com/invoiceninja/invoiceninja/releases/download/v${VERSION}/invoiceninja.tar.gz
|
||||
|
||||
# Debug output
|
||||
echo "Current version: ${VERSION}"
|
||||
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
|
||||
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
|
||||
echo "minor=${MINOR}" >> $GITHUB_OUTPUT
|
||||
echo "url=${URL}" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||
needs:
|
||||
- version
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
platform=${{ matrix.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: octane
|
||||
build-args: URL=${{ needs.version.outputs.url }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ env.REGISTRY_IMAGE }}
|
||||
outputs: type=image,push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-${{ env.PLATFORM_PAIR }}
|
||||
path: ${{ runner.temp }}/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- version
|
||||
- build
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
${{ needs.version.outputs.version }}
|
||||
${{ needs.version.outputs.major }}
|
||||
${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}
|
||||
latest
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/digests
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
|
||||
|
||||
- name: Inspect image
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
Description:
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- merge
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
sparse-checkout: "README.md"
|
||||
|
||||
- name: Docker Hub Description
|
||||
uses: peter-evans/dockerhub-description@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
repository: ${{ env.REGISTRY_IMAGE }}
|
||||
75
.github/workflows/publish-image.yaml
vendored
75
.github/workflows/publish-image.yaml
vendored
@@ -1,75 +0,0 @@
|
||||
name: Publish Debian Container Images
|
||||
|
||||
on:
|
||||
push:
|
||||
tags-ignore:
|
||||
- "invoiceninja-*"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- image: invoiceninja/invoiceninja-octane
|
||||
context: debian
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=${{ matrix.image }}
|
||||
VERSION=edge
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
fi
|
||||
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
||||
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
||||
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
||||
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
|
||||
|
||||
# Debug output
|
||||
echo "Current version: ${VERSION}"
|
||||
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
|
||||
|
||||
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
||||
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT # Updated output syntax
|
||||
echo "version=${VERSION}" >> $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
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3 # Updated from v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3 # Updated from v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5 # Updated from v2
|
||||
with:
|
||||
context: ${{ matrix.context }}
|
||||
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
cache-from: type=gha # Updated cache type
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Image 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
|
||||
29
README.md
29
README.md
@@ -1,13 +1,13 @@
|
||||
[](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
|
||||
[](https://hub.docker.com/r/invoiceninja/invoiceninja-debian)
|
||||
[](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image.yaml)
|
||||
[](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-v5.yaml)
|
||||
[](https://hub.docker.com/r/invoiceninja/invoiceninja-octane)
|
||||
[](https://hub.docker.com/r/invoiceninja/invoiceninja-octane)
|
||||
[](https://github.com/invoiceninja/dockerfiles/actions/workflows/publish-image-octane.yaml)
|
||||
[](https://github.com/invoiceninja/dockerfiles/actions/workflows/build-image-octane.yaml)
|
||||
|
||||
# Debian Docker for [Invoice Ninja](https://www.invoiceninja.com/)
|
||||
# Octane Docker for [Invoice Ninja](https://www.invoiceninja.com/)
|
||||
|
||||
:crown: **Features**
|
||||
👑 **Features**
|
||||
|
||||
NGINX webserver support [NGINX](https://nginx.org/)
|
||||
[FRANKENPHP](https://frankenphp.dev/)
|
||||
Built-in Chrome for PDF generation and other features
|
||||
Saxon XLST 2 engine
|
||||
OPcache
|
||||
@@ -18,8 +18,8 @@ Multi language support
|
||||
This Debian-based image includes Chrome for enhanced PDF generation and other features. To get started:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/invoiceninja/dockerfiles.git -b debian
|
||||
cd dockerfiles/debian
|
||||
git clone https://github.com/invoiceninja/dockerfiles.git -b octane
|
||||
cd dockerfiles/octane
|
||||
```
|
||||
|
||||
Instead of defining our environment variables inside our docker-compose.yml file we now define this in the `.env` file, open this file up and insert your `APP_URL`, `APP_KEY` and update the rest of the variables as required.
|
||||
@@ -51,10 +51,10 @@ The `APP_KEY` can be generated by running:
|
||||
|
||||
```bash
|
||||
# If you haven't started the containers yet:
|
||||
docker run --rm -it invoiceninja/invoiceninja-debian php artisan key:generate --show
|
||||
docker run --rm -it invoiceninja/invoiceninja-octane frankenphp php-cli artisan key:generate --show
|
||||
|
||||
# Or if your containers are already running:
|
||||
docker-compose exec app php artisan key:generate --show
|
||||
docker compose exec app frankenphp php-cli artisan key:generate --show
|
||||
```
|
||||
|
||||
Copy the entire string and insert in the .env file at `APP_KEY=base64....`
|
||||
@@ -64,7 +64,7 @@ Copy the entire string and insert in the .env file at `APP_KEY=base64....`
|
||||
Start the container with:
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
**Note: When performing the setup, the Database host is ```mysql```
|
||||
@@ -74,9 +74,8 @@ docker-compose up -d
|
||||
To upgrade to a newer release image, update your docker-compose.yml first by running:
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose pull
|
||||
docker-compose up
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
It is recommended to perform a backup before updating.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# IN application vars
|
||||
APP_URL=http://localhost:8012
|
||||
APP_URL=http://localhost
|
||||
APP_KEY=base64:RR++yx2rJ9kdxbdh3+AmbHLDQu+Q76i++co9Y8ybbno=
|
||||
APP_ENV=production
|
||||
APP_DEBUG=true
|
||||
@@ -4,8 +4,11 @@ ARG DEBIAN_VERSION=trixie
|
||||
|
||||
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-${DEBIAN_VERSION} AS prepare-app
|
||||
|
||||
RUN curl -sL "https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz" | \
|
||||
tar -xz \
|
||||
ARG URL=https://github.com/invoiceninja/invoiceninja/releases/latest/download/invoiceninja.tar.gz
|
||||
|
||||
ADD ${URL} /tmp/invoiceninja.tar.gz
|
||||
|
||||
RUN tar -xf /tmp/invoiceninja.tar.gz \
|
||||
&& ln -s ./resources/views/react/index.blade.php ./public/index.html \
|
||||
# Symlink
|
||||
&& php artisan storage:link \
|
||||
@@ -92,7 +95,7 @@ COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
||||
|
||||
USER ${user}
|
||||
|
||||
HEALTHCHECK --start-period=10s CMD curl -f http://localhost/health
|
||||
HEALTHCHECK --start-period=100s CMD curl -f http://localhost/health
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||
|
||||
@@ -1,30 +1,23 @@
|
||||
# name: invoiceninja
|
||||
|
||||
x-logging: &default-logging
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
driver: json-file
|
||||
|
||||
x-app-volumes: &volumes
|
||||
volumes:
|
||||
- ./.env:/app/.env
|
||||
- app_storage:/app/storage
|
||||
- caddy_data:/data
|
||||
- app_storage:/app/storage
|
||||
- caddy_data:/data
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
||||
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||
restart: unless-stopped
|
||||
# php artisan help octane:frankenphp
|
||||
command: --port=80 --workers=2 --log-level=info
|
||||
command: --port=80 --workers=2
|
||||
# command: --host=example.com --port=443 --workers=2 --https --http-redirect --log-level=info
|
||||
ports:
|
||||
- "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
|
||||
# - "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:
|
||||
@@ -39,10 +32,9 @@ services:
|
||||
# condition: service_healthy
|
||||
# valkey:
|
||||
# condition: service_healthy
|
||||
logging: *default-logging
|
||||
|
||||
|
||||
app-worker:
|
||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
||||
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||
restart: unless-stopped
|
||||
# php artisan help queue:work
|
||||
command: --verbose --sleep=3 --tries=3 --max-time=3600
|
||||
@@ -56,14 +48,12 @@ services:
|
||||
<<: *volumes
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "-f", "queue:work"]
|
||||
start_period: 10s
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
logging: *default-logging
|
||||
|
||||
app-scheduler:
|
||||
image: invoiceninja/invoiceninja-debian:${TAG:-latest}
|
||||
image: invoiceninja/invoiceninja-octane:${TAG:-latest}
|
||||
restart: unless-stopped
|
||||
# php artisan help schedule:work
|
||||
command: --verbose
|
||||
@@ -74,17 +64,13 @@ services:
|
||||
<<: *volumes
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "-f", "schedule:work"]
|
||||
start_period: 10s
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
logging: *default-logging
|
||||
|
||||
mysql:
|
||||
image: mysql:8
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
MYSQL_DATABASE: ${DB_DATABASE}
|
||||
MYSQL_USER: ${DB_USERNAME}
|
||||
@@ -93,11 +79,16 @@ services:
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u${MYSQL_USER}", "-p${MYSQL_PASSWORD}" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
logging: *default-logging
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"mysqladmin",
|
||||
"ping",
|
||||
"-h",
|
||||
"localhost",
|
||||
"-u${MYSQL_USER}",
|
||||
"-p${MYSQL_PASSWORD}",
|
||||
]
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
@@ -105,17 +96,11 @@ services:
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
logging: *default-logging
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
|
||||
# mariadb:
|
||||
# image: mariadb:11.4
|
||||
# image: mariadb:11.8
|
||||
# restart: unless-stopped
|
||||
# env_file:
|
||||
# - ./.env
|
||||
# environment:
|
||||
# MARIADB_DATABASE: ${DB_DATABASE}
|
||||
# MARIADB_USER: ${DB_USERNAME}
|
||||
@@ -125,8 +110,6 @@ services:
|
||||
# - mariadb:/var/lib/mysql
|
||||
# healthcheck:
|
||||
# test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
# start_period: 60s
|
||||
# logging: *default-logging
|
||||
|
||||
# valkey:
|
||||
# image: valkey/valkey:8
|
||||
@@ -135,8 +118,7 @@ services:
|
||||
# - valkey:/data
|
||||
# healthcheck:
|
||||
# test: [ "CMD", "valkey-cli", "ping" ]
|
||||
# start_period: 10s
|
||||
# logging: *default-logging
|
||||
|
||||
|
||||
volumes:
|
||||
app_storage:
|
||||
@@ -2,6 +2,7 @@
|
||||
; https://www.php.net/manual/en/ini.core.php
|
||||
post_max_size=10M
|
||||
upload_max_filesize=10M
|
||||
memory_limit=512M
|
||||
|
||||
[opcache]
|
||||
; https://www.php.net/manual/en/opcache.installation.php#opcache.installation.recommended
|
||||
@@ -46,31 +46,30 @@ if [ "$*" = 'frankenphp php-cli artisan octane:frankenphp' ] || [ "${1#-}" != "$
|
||||
|
||||
# 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
|
||||
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
|
||||
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 migrate --force
|
||||
frankenphp php-cli artisan db:seed --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
|
||||
echo "Running initialization..."
|
||||
|
||||
frankenphp php-cli artisan db:seed --force
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user