mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-02-05 21:57:10 +01:00
Complete build pipeline to include debian image
This commit is contained in:
52
.github/workflows/build-image-debian.yaml
vendored
Normal file
52
.github/workflows/build-image-debian.yaml
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: Build Debian Container Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "debian/**"
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "debian/**"
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-debian-buildx-${{ hashFiles('debian/cache_buster') }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-debian-buildx-${{ hashFiles('debian/cache_buster') }}-
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: ./debian/
|
||||||
|
build-args: INVOICENINJA_VERSION=5-develop
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: invoiceninja/invoiceninja-debian:cache
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||||
|
|
||||||
|
- name: Move cache
|
||||||
|
run: |
|
||||||
|
rm -rf /tmp/.buildx-cache
|
||||||
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||||
22
.github/workflows/publish-image.yaml
vendored
22
.github/workflows/publish-image.yaml
vendored
@@ -1,9 +1,5 @@
|
|||||||
name: Publish Container Image
|
name: Publish Container Images
|
||||||
|
|
||||||
# When its time to do a release do a full cross platform build for all supported
|
|
||||||
# architectures and push all of them to Docker Hub.
|
|
||||||
# Only trigger on semver shaped tags.
|
|
||||||
# Ref: https://github.com/metcalfc/docker-action-examples/blob/main/.github/workflows/release.yml
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags-ignore:
|
tags-ignore:
|
||||||
@@ -12,6 +8,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- image: invoiceninja/invoiceninja
|
||||||
|
context: ./alpine/5/
|
||||||
|
- image: invoiceninja/invoiceninja-debian
|
||||||
|
context: ./debian/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -19,7 +23,7 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=invoiceninja/invoiceninja
|
DOCKER_IMAGE=${{ matrix.image }}
|
||||||
VERSION=edge
|
VERSION=edge
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
@@ -48,9 +52,9 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('alpine/${{ steps.prep.outputs.major }}/cache_buster') }}-${{ github.sha }}
|
key: ${{ runner.os }}-${{ matrix.image }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('**/cache_buster') }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('alpine/${{ steps.prep.outputs.major }}/cache_buster') }}-
|
${{ runner.os }}-${{ matrix.image }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('**/cache_buster') }}-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
@@ -64,7 +68,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: ./alpine/${{ steps.prep.outputs.major }}/
|
context: ${{ matrix.context }}
|
||||||
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
||||||
target: prod
|
target: prod
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|||||||
9
debian/.env
vendored
9
debian/.env
vendored
@@ -1,5 +1,5 @@
|
|||||||
# IN application vars
|
# IN application vars
|
||||||
APP_URL=http://in.localhost:8003
|
APP_URL=http://localhost:8012
|
||||||
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
|
||||||
@@ -46,6 +46,7 @@ MYSQL_DATABASE=ninja
|
|||||||
NORDIGEN_SECRET_ID=
|
NORDIGEN_SECRET_ID=
|
||||||
NORDIGEN_SECRET_KEY=
|
NORDIGEN_SECRET_KEY=
|
||||||
|
|
||||||
# V4 env vars
|
IS_DOCKER=true
|
||||||
# DB_STRICT=false
|
SCOUT_DRIVER=null
|
||||||
# APP_CIPHER=AES-256-CBC
|
SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
|
||||||
|
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome
|
||||||
|
|||||||
23
debian/Dockerfile
vendored
23
debian/Dockerfile
vendored
@@ -1,5 +1,5 @@
|
|||||||
FROM php:8.2-fpm AS base
|
FROM php:8.2-fpm AS base
|
||||||
ARG saxon=12.3
|
ARG saxon=12.5.0
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
@@ -44,6 +44,21 @@ RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd6
|
|||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Set permissions for www-data to execute
|
||||||
|
RUN mkdir -p /var/www/.chrome/chrome-profile \
|
||||||
|
&& chown -R www-data:www-data /var/www/.chrome \
|
||||||
|
&& chmod -R 755 /var/www/.chrome \
|
||||||
|
&& chown root:root /usr/bin/google-chrome \
|
||||||
|
&& chmod 4755 /usr/bin/google-chrome \
|
||||||
|
&& chown -R root:root /opt/google/chrome \
|
||||||
|
&& chmod -R 755 /opt/google/chrome \
|
||||||
|
&& chown -R www-data:www-data /var/www
|
||||||
|
|
||||||
|
# Create required directories with proper permissions
|
||||||
|
RUN mkdir -p /tmp/chrome \
|
||||||
|
&& chown -R www-data:www-data /tmp/chrome \
|
||||||
|
&& chmod -R 755 /tmp/chrome
|
||||||
|
|
||||||
# Copy Install PHP extensions installer
|
# Copy Install PHP extensions installer
|
||||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
@@ -73,10 +88,10 @@ COPY php/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
|
|||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
## fetch
|
## fetch
|
||||||
RUN curl https://www.saxonica.com/download/libsaxon-HEC-linux-v${saxon}.zip --output saxon.zip
|
RUN curl https://downloads.saxonica.com/SaxonC/HE/12/libsaxon-HEC-linux-x86_64-v${saxon}.zip --output saxon.zip
|
||||||
RUN unzip saxon.zip -d saxon
|
RUN unzip saxon.zip -d saxon
|
||||||
RUN cp saxon/libsaxon-HEC-linux-v${saxon}/libs/nix/libsaxon-hec-${saxon}.so /usr/lib/
|
RUN cp saxon/libsaxon-HEC-linux-amd64-v${saxon}/libs/nix/libsaxon-hec-${saxon}.so /usr/lib/
|
||||||
WORKDIR /opt/saxon/libsaxon-HEC-linux-v${saxon}/Saxon.C.API
|
WORKDIR /opt/saxon/libsaxon-HEC-linux-amd64-v${saxon}/Saxon.C.API
|
||||||
RUN phpize
|
RUN phpize
|
||||||
RUN ./configure --enable-saxon
|
RUN ./configure --enable-saxon
|
||||||
RUN make
|
RUN make
|
||||||
|
|||||||
4
debian/docker-compose.yml
vendored
4
debian/docker-compose.yml
vendored
@@ -8,7 +8,7 @@ x-logging: &default-logging
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: deb39b:latest
|
image: deb39e:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8012:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
||||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
|||||||
Reference in New Issue
Block a user