mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-28 01:37:12 +01:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
394c4c8b5e | ||
|
|
9ed63a6762 | ||
|
|
cb6d6d46c2 | ||
|
|
3b0e475de6 | ||
|
|
d5bb90fa04 | ||
|
|
1b62d86659 | ||
|
|
4431abcb88 | ||
|
|
d05e55a24e | ||
|
|
34e5043317 | ||
|
|
6f92d1c155 | ||
|
|
11330003a2 | ||
|
|
47b015af7c | ||
|
|
c6648a8511 | ||
|
|
de2036adff | ||
|
|
ea8c5fed8e | ||
|
|
c2f8cedc4a | ||
|
|
7ddfe8a793 | ||
|
|
196e66e06d | ||
|
|
7498a94bd1 | ||
|
|
8289c6c65e | ||
|
|
b75ac4fd87 | ||
|
|
94d3f6212e | ||
|
|
a940bf2ed2 |
46
.github/workflows/publish-image.yaml
vendored
46
.github/workflows/publish-image.yaml
vendored
@@ -16,7 +16,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4 # Updated from v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
@@ -30,54 +32,44 @@ jobs:
|
|||||||
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
||||||
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
||||||
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
|
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
|
||||||
if [[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
|
||||||
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
# Debug output
|
||||||
fi
|
echo "Current version: ${VERSION}"
|
||||||
echo ::set-output name=tags::${TAGS}
|
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
|
||||||
echo ::set-output name=version::${VERSION}
|
|
||||||
echo ::set-output name=major::${MAJOR}
|
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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3 # Updated from v1
|
||||||
with:
|
with:
|
||||||
platforms: all
|
platforms: all
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3 # Updated from v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-${{ matrix.image }}-buildx-${{ steps.prep.outputs.major }}-${{ hashFiles('**/cache_buster') }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ 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'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3 # Updated from v1
|
||||||
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@v2
|
uses: docker/build-push-action@v5 # Updated from v2
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
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
|
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=local,src=/tmp/.buildx-cache
|
cache-from: type=gha # Updated cache type
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
@@ -19,7 +19,7 @@ This Debian-based image includes Chrome for enhanced PDF generation and other fe
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/invoiceninja/dockerfiles.git -b debian
|
git clone https://github.com/invoiceninja/dockerfiles.git -b debian
|
||||||
cd dockerfiles
|
cd dockerfiles/debian
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
@@ -41,7 +41,9 @@ Prior to starting the container for the first time, open the .env file and updat
|
|||||||
This will take care of the initial account setup. You can later remove these .env variables.
|
This will take care of the initial account setup. You can later remove these .env variables.
|
||||||
|
|
||||||
> ⚠️ **Warning**
|
> ⚠️ **Warning**
|
||||||
> If `IN_USER_EMAIL` and `IN_PASSWORD` is not set the default user email and password is "admin@example.com" and "changeme!" respectively. You will use this for the initial login, thereafter, you can delete these two environment variables.
|
> If `IN_USER_EMAIL` and `IN_PASSWORD` are not set the default user email and password is "admin@example.com" and "changeme!" respectively.
|
||||||
|
|
||||||
|
After the container has completed the first startup you can delete these two environment variables.
|
||||||
|
|
||||||
### Generate a APP_KEY
|
### Generate a APP_KEY
|
||||||
|
|
||||||
|
|||||||
5
debian/.env
vendored
5
debian/.env
vendored
@@ -8,7 +8,10 @@ PHANTOMJS_PDF_GENERATION=false
|
|||||||
PDF_GENERATOR=snappdf
|
PDF_GENERATOR=snappdf
|
||||||
TRUSTED_PROXIES='*'
|
TRUSTED_PROXIES='*'
|
||||||
|
|
||||||
QUEUE_CONNECTION=database
|
QUEUE_CONNECTION=redis
|
||||||
|
|
||||||
|
|
||||||
|
# FILESYSTEM_DISK=local
|
||||||
|
|
||||||
# DB connection
|
# DB connection
|
||||||
DB_HOST=mysql
|
DB_HOST=mysql
|
||||||
|
|||||||
6
debian/Dockerfile
vendored
6
debian/Dockerfile
vendored
@@ -106,7 +106,7 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
|
|||||||
&& make install \
|
&& make install \
|
||||||
&& echo 'extension=saxon.so' > "/usr/local/etc/php/conf.d/app.ini"; \
|
&& echo 'extension=saxon.so' > "/usr/local/etc/php/conf.d/app.ini"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy scripts
|
# Copy scripts
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
|
|
||||||
@@ -118,7 +118,6 @@ RUN set -eux; \
|
|||||||
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
|
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
|
||||||
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | cut -d '"' -f 4) && \
|
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | cut -d '"' -f 4) && \
|
||||||
curl -L "$DOWNLOAD_URL" | tar -xvz -C /var/www/html && \
|
curl -L "$DOWNLOAD_URL" | tar -xvz -C /var/www/html && \
|
||||||
rm -rf /var/www/html/ui && \
|
|
||||||
chown -R www-data:www-data /var/www/html
|
chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
@@ -129,7 +128,8 @@ RUN composer dump-autoload --optimize \
|
|||||||
&& php artisan optimize \
|
&& php artisan optimize \
|
||||||
&& php artisan view:cache \
|
&& php artisan view:cache \
|
||||||
&& php artisan config:cache \
|
&& php artisan config:cache \
|
||||||
&& php artisan route:cache
|
&& php artisan route:cache \
|
||||||
|
&& php artisan storage:link
|
||||||
|
|
||||||
# Setup supervisor
|
# Setup supervisor
|
||||||
COPY supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|||||||
17
debian/docker-compose.yml
vendored
17
debian/docker-compose.yml
vendored
@@ -8,7 +8,7 @@ x-logging: &default-logging
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: invoiceninja/invoiceninja-debian:5
|
image: invoiceninja/invoiceninja-debian:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
- ./.env:/var/www/html/.env
|
- ./.env:/var/www/html/.env
|
||||||
- app_storage:/var/www/html/storage
|
- app_storage:/var/www/html/storage
|
||||||
- app_cache:/var/www/html/bootstrap/cache
|
- app_cache:/var/www/html/bootstrap/cache
|
||||||
- public_files:/var/www/html/public
|
- public_storage:/var/www/html/public/storage
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
@@ -39,10 +39,9 @@ services:
|
|||||||
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
|
||||||
- type: volume
|
volumes_from:
|
||||||
source: public_files
|
- app
|
||||||
target: /var/www/html/public
|
|
||||||
read_only: true
|
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -103,13 +102,11 @@ networks:
|
|||||||
volumes:
|
volumes:
|
||||||
app_storage:
|
app_storage:
|
||||||
driver: local
|
driver: local
|
||||||
app_public:
|
|
||||||
driver: local
|
|
||||||
app_cache:
|
app_cache:
|
||||||
driver: local
|
driver: local
|
||||||
|
public_storage:
|
||||||
|
driver: local # Persistent storage for user files
|
||||||
mysql_data:
|
mysql_data:
|
||||||
driver: local
|
driver: local
|
||||||
redis_data:
|
redis_data:
|
||||||
driver: local
|
|
||||||
public_files:
|
|
||||||
driver: local
|
driver: local
|
||||||
2
debian/php/php-fpm.conf
vendored
2
debian/php/php-fpm.conf
vendored
@@ -3,7 +3,7 @@ user = www-data
|
|||||||
group = www-data
|
group = www-data
|
||||||
listen = 0.0.0.0:9000
|
listen = 0.0.0.0:9000
|
||||||
pm = dynamic
|
pm = dynamic
|
||||||
pm.max_children = 5
|
pm.max_children = 10
|
||||||
pm.start_servers = 2
|
pm.start_servers = 2
|
||||||
pm.min_spare_servers = 1
|
pm.min_spare_servers = 1
|
||||||
pm.max_spare_servers = 3
|
pm.max_spare_servers = 3
|
||||||
14
debian/scripts/init.sh
vendored
14
debian/scripts/init.sh
vendored
@@ -36,20 +36,22 @@ mkdir -p \
|
|||||||
/var/www/html/storage/framework/sessions \
|
/var/www/html/storage/framework/sessions \
|
||||||
/var/www/html/storage/framework/views \
|
/var/www/html/storage/framework/views \
|
||||||
/var/www/html/storage/logs \
|
/var/www/html/storage/logs \
|
||||||
/var/www/html/public/uploads
|
/var/www/html/public/storage
|
||||||
|
|
||||||
# Set directory permissions without changing ownership
|
# Set directory permissions without changing ownership
|
||||||
chmod -R 775 \
|
chmod -R 775 \
|
||||||
/var/www/html/storage \
|
/var/www/html/storage \
|
||||||
/var/www/html/bootstrap/cache \
|
/var/www/html/bootstrap/cache \
|
||||||
/var/www/html/public/uploads
|
/var/www/html/public/storage
|
||||||
|
|
||||||
|
chown -R www-data:www-data /var/www/html/storage
|
||||||
|
|
||||||
# Clear and cache config in production
|
# Clear and cache config in production
|
||||||
if [ "$APP_ENV" = "production" ]; then
|
if [ "$APP_ENV" = "production" ]; then
|
||||||
php artisan config:cache
|
gosu www-data php artisan config:cache
|
||||||
php artisan optimize
|
gosu www-data php artisan optimize
|
||||||
php artisan package:discover
|
gosu www-data php artisan package:discover
|
||||||
php artisan migrate --force
|
gosu www-data php artisan migrate --force
|
||||||
|
|
||||||
echo "Checking initialization status..."
|
echo "Checking initialization status..."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user