Compare commits

...

14 Commits

Author SHA1 Message Date
David Bomba
81617a3dec Updates for build 2024-06-07 21:10:51 +10:00
David Bomba
a874ceb7c2 Merge pull request #581 from chaseSpace/master
build: add Chinese font pkg support
2024-06-06 13:06:47 +10:00
Leigg
4a3d8783d4 build: add Chinese font pkg support
Signed-off-by: Leigg <34116031+chaseSpace@users.noreply.github.com>
2024-06-06 09:44:17 +08:00
David Bomba
84a6637f80 Merge pull request #575 from julianengel/patch-1
Added GoCardless/Nordigen key to env file
2024-05-02 08:35:54 +10:00
Julian Engel
821f3f5ec7 Added GoCardless/Nordigen key to env file
Signed-off-by: Julian Engel <julianengel@users.noreply.github.com>
2024-05-01 15:47:35 +02:00
David Bomba
dafd4051d3 Merge pull request #572 from turbo124/master
Updates for react release
2024-04-05 08:45:27 +11:00
David Bomba
c6b44487f3 Updates for react release 2024-04-05 08:45:03 +11:00
David Bomba
b2e03ce544 Merge pull request #570 from turbo124/master
Rollback copy
2024-04-05 07:29:10 +11:00
David Bomba
78fd70118a Rollback copy 2024-04-05 07:28:47 +11:00
David Bomba
59616eada8 Merge pull request #569 from turbo124/master
Set react as default interface
2024-04-04 22:02:58 +11:00
David Bomba
0fab60378a Improvements for build 2024-04-04 22:02:17 +11:00
David Bomba
47db01612d Improvements for build 2024-04-04 22:01:41 +11:00
David Bomba
1a1cea632b Merge pull request #568 from turbo124/master
Refactor build steps
2024-04-04 20:05:01 +11:00
David Bomba
5609b988f3 Refactor build steps 2024-04-04 20:04:13 +11:00
5 changed files with 25 additions and 31 deletions

View File

@@ -44,7 +44,7 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./alpine/5/
build-args: INVOICENINJA_VERSION=5-stable
build-args: INVOICENINJA_VERSION=5-develop
target: prod
platforms: linux/amd64,linux/arm64
tags: invoiceninja/invoiceninja:cache

View File

@@ -7,28 +7,21 @@ FROM --platform=$BUILDPLATFORM node:lts-alpine as nodebuild
# Download Invoice Ninja
ARG INVOICENINJA_VERSION
ADD https://github.com/invoiceninja/invoiceninja/tarball/v$INVOICENINJA_VERSION /tmp/ninja.tar.gz
ADD https://github.com/invoiceninja/invoiceninja/releases/download/v$INVOICENINJA_VERSION/react-invoiceninja.tar /tmp/ninja.tar
RUN set -eux; apk add curl unzip
# Extract Invoice Ninja
RUN mkdir -p /var/www/app \
&& tar --strip-components=1 -xf /tmp/ninja.tar.gz -C /var/www/app/ \
&& tar -xvf /tmp/ninja.tar -C /var/www/app/ \
&& mkdir -p /var/www/app/public/logo /var/www/app/storage
# Download and extract the latest react application
RUN curl -LGO $(curl https://api.github.com/repos/invoiceninja/ui/releases/latest | grep "browser_download_url" | awk '{ print $2 }' | sed 's/,$//' | sed 's/"//g');
RUN cp invoiceninja-react.zip /tmp/invoiceninja-react.zip
RUN unzip /tmp/invoiceninja-react.zip
RUN mkdir /var/www/app/public/react/v$INVOICENINJA_VERSION/
RUN cp -r dist/react/* /var/www/app/public/react/v$INVOICENINJA_VERSION/
RUN cp -r dist/react/* /var/www/app/public/react/
RUN mkdir -p /var/www/app/public/tinymce_6.4.2/tinymce/js/
RUN cp -r dist/tinymce_6.4.2/* /var/www/app/public/tinymce_6.4.2/
WORKDIR /var/www/app
RUN echo ls -l
RUN cp /var/www/app/ui/dist/index.html /var/www/app/resources/views/react/index.blade.php
# Download and extract the latest react application
#
# Prepare php image
FROM php:${PHP_VERSION}-fpm-alpine as phpbuild
@@ -45,14 +38,15 @@ RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install chromium
# `ttf-dejavu` is Chinese supported fonts
RUN set -eux; \
apk add --no-cache \
font-isas-misc \
supervisor \
mysql-client \
git \
chromium \
ttf-freefont
ttf-freefont \
ttf-dejavu
RUN install-php-extensions \
bcmath \
@@ -81,6 +75,8 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \
--ingroup "$INVOICENINJA_USER" \
"$INVOICENINJA_USER"
WORKDIR /var/www/app
# Set up app
ARG INVOICENINJA_VERSION
ARG BAK_STORAGE_PATH
@@ -90,28 +86,24 @@ ENV BAK_STORAGE_PATH $BAK_STORAGE_PATH
ENV BAK_PUBLIC_PATH $BAK_PUBLIC_PATH
COPY --from=nodebuild --chown=$INVOICENINJA_USER:$INVOICENINJA_USER /var/www/app /var/www/app
RUN rm -rf /var/www/app/ui
USER $UID
WORKDIR /var/www/app
# Do not remove this ENV
ENV IS_DOCKER true
RUN /usr/local/bin/composer install --no-dev --no-scripts --no-interaction
RUN /usr/local/bin/composer dump-autoload --optimize --no-dev --classmap-authoritative --no-scripts --no-interaction
FROM --platform=$BUILDPLATFORM nodebuild AS dependencybuild
WORKDIR /var/www/app
COPY --from=phpbuild /var/www/app /var/www/app
COPY --from=phpbuild /var/www/app/vendor /var/www/app/vendor
# Install node packages
# # Install node packages
ARG BAK_STORAGE_PATH
ARG BAK_PUBLIC_PATH
RUN --mount=target=/var/www/app/node_modules,type=cache \
npm install \
&& npm run production \
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
&& mv /var/www/app/public $BAK_PUBLIC_PATH
RUN mv /var/www/app/storage $BAK_STORAGE_PATH \
&& mv /var/www/app/public $BAK_PUBLIC_PATH
FROM phpbuild as prod

View File

@@ -11,5 +11,4 @@ if [[ ! -z "${IN_PASSWORD}" ]]; then
password="--password ${IN_PASSWORD}"
fi
php artisan ninja:create-account $email $password
php artisan ninja:react
php artisan ninja:create-account $email $password

View File

@@ -28,7 +28,6 @@ docker_process_init_files() {
php artisan config:cache
php artisan optimize
php artisan package:discover
php artisan ninja:react
# Check if DB works, if not crash the app.
DB_READY=$(php artisan tinker --execute='echo app()->call("App\Utils\SystemHealth@dbCheck")["success"];')

4
env
View File

@@ -40,6 +40,10 @@ MYSQL_USER=ninja
MYSQL_PASSWORD=ninja
MYSQL_DATABASE=ninja
# GoCardless/Nordigen API key for banking integration
NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=
# V4 env vars
# DB_STRICT=false
# APP_CIPHER=AES-256-CBC