docker compose updates

This commit is contained in:
jon brookes 2026-01-26 15:20:11 +00:00
parent 0d908a054b
commit 53d96e48a7
4 changed files with 25 additions and 21 deletions

View file

@ -1,6 +1,6 @@
when: when:
- event: push - event: push
branch: dev branch: feat/docker-compose-update
steps: steps:
build-local: build-local:
image: docker:24-dind image: docker:24-dind

View file

@ -2,6 +2,10 @@
Share Light CMS Share Light CMS
[![status-badge](https://wpk.headshed.dev/api/badges/2/status.svg)](https://wpk.headshed.dev/repos/2) [![Docker Repository on Quay](https://quay.io/repository/marshyon/share-lt/status "Docker Repository on Quay")](https://quay.io/repository/marshyon/share-lt)
this project is in 'Alpha' this project is in 'Alpha'
it is published as "R&D", open source, [GNU AFFERO GENERAL PUBLIC V3](LICENSE) it is published as "R&D", open source, [GNU AFFERO GENERAL PUBLIC V3](LICENSE)

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
LARAVEL_CONTAINER_NAME="quay.io/marshyon/share-lt" LARAVEL_CONTAINER_NAME="quay.io/marshyon/share-lt"
CONTAINER_LABEL="0.0.2" CONTAINER_LABEL="0.0.3"
CACHE="--no-cache" CACHE="--no-cache"
CACHE="" CACHE=""

View file

@ -1,16 +1,16 @@
#!/bin/sh #!/bin/sh
set -e set -e
run_as_www() { # run_as_www() {
# prefer su-exec (alpine), fallback to runuser if available, otherwise run directly # # prefer su-exec (alpine), fallback to runuser if available, otherwise run directly
if command -v su-exec >/dev/null 2>&1; then # if command -v su-exec >/dev/null 2>&1; then
su-exec www "$@" # su-exec www "$@"
elif command -v runuser >/dev/null 2>&1; then # elif command -v runuser >/dev/null 2>&1; then
runuser -u www -- "$@" # runuser -u www -- "$@"
else # else
"$@" # "$@"
fi # fi
} # }
# Build front-end assets if Vite manifest is missing # Build front-end assets if Vite manifest is missing
if [ ! -f /var/www/public/build/manifest.json ]; then if [ ! -f /var/www/public/build/manifest.json ]; then
@ -20,17 +20,17 @@ if [ ! -f /var/www/public/build/manifest.json ]; then
fi fi
# Wait for database directory to be mounted # Wait for database directory to be mounted
if [ ! -f /var/www/database/database.sqlite ]; then # if [ ! -f /var/www/database/database.sqlite ]; then
echo "Creating database..." # echo "Creating database..."
# create the sqlite file as the www user so ownership matches app files # # create the sqlite file as the www user so ownership matches app files
run_as_www sh -c 'touch /var/www/database/database.sqlite' # run_as_www sh -c 'touch /var/www/database/database.sqlite'
run_as_www php artisan migrate --force # run_as_www php artisan migrate --force
fi # fi
# Fix storage permissions # Fix storage permissions
echo "Fixing storage permissions..." # echo "Fixing storage permissions..."
chown -R www:www /var/www/storage /var/www/bootstrap/cache # chown -R www:www /var/www/storage /var/www/bootstrap/cache
chmod -R 775 /var/www/storage /var/www/bootstrap/cache # chmod -R 775 /var/www/storage /var/www/bootstrap/cache
# Execute the main command # Execute the main command
exec "$@" exec "$@"