Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PUID=1000
PGID=1000
PHP_TZ=UTC
LOG_VIEWER_CACHE_DRIVER=file
2 changes: 1 addition & 1 deletion .github/workflows/build_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set Password
run: "sed -i 's/<.*_PASSWORD>/password/g' docker-compose.yml"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: docker/setup-buildx-action@v3
-
name: Test multiarch building
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
Expand All @@ -35,7 +35,7 @@ jobs:
lycheeorg/lychee:testing-${{ github.run_id }}
-
name: Save amd64 image to pass to testing
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
Expand All @@ -54,7 +54,7 @@ jobs:
sha256sum artifact/lychee.tar || echo 0
-
name: Store as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact
path: ./artifact
8 changes: 4 additions & 4 deletions .github/workflows/test_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
-
name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
-
name: "Create check"
id: create_check
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
parameter_url: '${{ github.event.workflow_run.html_url }}'
with:
Expand All @@ -80,7 +80,7 @@ jobs:
run: docker image load -i ./lychee.tar
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
steps:
-
name: "Update check"
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
await github.rest.checks.update({
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bookworm-slim as base
FROM debian:bookworm-slim AS base

# Set version label
LABEL maintainer="lycheeorg"
Expand Down Expand Up @@ -89,11 +89,11 @@
echo "* * * * * www-data cd /var/www/html/Lychee && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab && \
apt-get purge -y --autoremove git composer && \
apt-get clean -qy &&\
rm -rf /var/lib/apt/lists/*

Check warning on line 92 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Empty continuation lines will become errors in a future release

NoEmptyContinuation: Empty continuation line More info: https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/

Check warning on line 92 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Empty continuation lines will become errors in a future release

NoEmptyContinuation: Empty continuation line More info: https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/

# Multi-stage build: Build static assets
# This allows us to not include Node within the final container
FROM node:20 as static_builder
FROM node:20 AS static_builder

RUN mkdir /app

Expand Down
61 changes: 43 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,33 @@
#-------------------------------------------

services:
lychee_cache:
image: redis:alpine
container_name: lychee_redis
hostname: lychee_redis
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
ports:
- ${REDIS_PORT:-6379}:${REDIS_PORT:-6379}
user: 1026:100
environment:
- TZ=${TIMEZONE:-UTC}
networks:
- lychee
volumes:
- cache:/data:rw
restart: on-failure:5

lychee_db:
container_name: lychee_db
image: mariadb:10
environment:
- MYSQL_ROOT_PASSWORD=<ROOT_PASSWORD>
- MYSQL_DATABASE=lychee
- MYSQL_USER=lychee
- MYSQL_PASSWORD=<LYCHEE_PASSWORD>
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-rootpassword}
- MYSQL_DATABASE=${DB_DATABASE:-lychee}
- MYSQL_USER=${DB_USERNAME:-lychee}
- MYSQL_PASSWORD=${DB_PASSWORD}
expose:
- 3306
volumes:
Expand All @@ -22,7 +41,7 @@ services:
restart: unless-stopped

lychee:
image: lycheeorg/lychee
image: lycheeorg/lychee:nightly
container_name: lychee
ports:
- 90:80
Expand All @@ -38,13 +57,13 @@ services:
#- PUID=1000
#- PGID=1000
# PHP timezone e.g. PHP_TZ=America/New_York
- PHP_TZ=UTC
- TIMEZONE=UTC
- PHP_TZ=${TIMEZONE:-UTC}
- TIMEZONE=${TIMEZONE:-UTC}
#- APP_NAME=Laravel
#- APP_ENV=local
#- APP_DEBUG=true
#- APP_FORCE_HTTPS=false
#- APP_URL=http://localhost
- APP_URL=${APP_URL:-http://localhost}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already the default - does this one not pass through?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes it easier to modify in .env without having to fiddle in lychee/config/.env as misconfiguration of this value is the first cause of failure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's an env value, so wouldn't it work when modified in .env anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the idea was that setting APP_URL in .env set the environment variable in the container rather than in the shell? Which would mean this should pass through without adding that line.

#- APP_DIR=
#- DEBUGBAR_ENABLEd=false
#- VUEJS_ENABLED=true
Expand All @@ -53,10 +72,10 @@ services:
#- DB_OLD_LYCHEE_PREFIX=''
- DB_CONNECTION=mysql
- DB_HOST=lychee_db
- DB_PORT=3306
- DB_DATABASE=lychee
- DB_USERNAME=lychee
- DB_PASSWORD=<LYCHEE_PASSWORD>
- DB_PORT=${DB_PORT:-3306}
- DB_DATABASE=${DB_DATABASE:-lychee}
- DB_USERNAME=${DB_USERNAME:-lychee}
- DB_PASSWORD=${DB_PASSWORD}
#- DB_PASSWORD_FILE=<filename>
#- DB_LOG_SQL=false
#- DB_LOG_SQL_EXPLAIN=false
Expand All @@ -79,16 +98,17 @@ services:
#- MAIL_FROM_NAME=
#- MAIL_FROM_ADDRESS=
#- TRUSTED_PROXIES=
#- SKIP_PERMISSIONS_CHECKS
- SKIP_PERMISSIONS_CHECKS=${SKIP_PERMISSIONS_CHECKS:-false}
- STARTUP_DELAY=30
#- ADMIN_USER=admin
#- ADMIN_PASSWORD=<ADMIN_PASSWORD>
#- ADMIN_PASSWORD_FILE=<filename>
### Unused in Lychee
#- REDIS_HOST=127.0.0.1
#- REDIS_PASSWORD=null
#- REDIS_PASSWORD_FILE=<filename>
#- REDIS_PORT=6379
- CACHE_DRIVER=${CACHE_DRIVER:-redis}
- REDIS_URL=redis://${REDIS_USERNAME:-default}:${REDIS_PASSWORD:-}@${REDIS_HOST:-lychee_redis}:${REDIS_PORT:-6379}
- REDIS_HOST=${REDIS_HOST:-lychee_redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- LOG_VIEWER_CACHE_DRIVER=${LOG_VIEWER_CACHE_DRIVER:-file}
restart: unless-stopped
depends_on:
- lychee_db
Expand All @@ -98,3 +118,8 @@ networks:

volumes:
mysql:
name: lychee_prod_mysql
driver: local
cache:
name: lychee_prod_redis
driver: local
44 changes: 25 additions & 19 deletions inject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ if [ "$ENABLE_TOKEN_AUTH" != '' ]; then
if [ "$CACHE_DRIVER" != '' ]; then
replace_or_insert "CACHE_DRIVER" "$CACHE_DRIVER"
fi
if [ "$LOG_VIEWER_CACHE_DRIVER" != '' ]; then
replace_or_insert "LOG_VIEWER_CACHE_DRIVER" "$LOG_VIEWER_CACHE_DRIVER"
fi
if [ "$SESSION_DRIVER" != '' ]; then
replace_or_insert "SESSION_DRIVER" "$SESSION_DRIVER"
fi
Expand All @@ -132,25 +135,28 @@ if [ "$SECURITY_HEADER_SCRIPT_SRC_ALLOW" != '' ]; then
fi
if [ "$SESSION_SECURE_COOKIE" != '' ]; then
replace_or_insert "SESSION_SECURE_COOKIE" "$SESSION_SECURE_COOKIE"
fi
# if [ "$REDIS_SCHEME" != '' ]; then
# sed -i "s|REDIS_SCHEME=.*|REDIS_SCHEME=${REDIS_SCHEME}|i" /conf/.env
# fi
# if [ "$REDIS_PATH" != '' ]; then
# sed -i "s|REDIS_PATH=.*|REDIS_PATH=${REDIS_PATH}|i" /conf/.env
# fi
# if [ "$REDIS_HOST" != '' ]; then
# sed -i "s|REDIS_HOST=.*|REDIS_HOST=${REDIS_HOST}|i" /conf/.env
# fi
# if [ "$REDIS_PORT" != '' ]; then
# sed -i "s|REDIS_PORT=.*|REDIS_PORT=${REDIS_PORT}|i" /conf/.env
# fi
# if [ "$REDIS_PASSWORD" != '' ]; then
# sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=${REDIS_PASSWORD}|i" /conf/.env
# elif [ "$REDIS_PASSWORD_FILE" != '' ]; then
# value=$(<$REDIS_PASSWORD_FILE)
# sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=${value}|i" /conf/.env
# fi
fi
if [ "$REDIS_URL" != '' ]; then
sed -i "s|REDIS_URL=.*|REDIS_URL=${REDIS_URL}|i" /conf/.env
fi
if [ "$REDIS_PATH" != '' ]; then
sed -i "s|REDIS_PATH=.*|REDIS_PATH=${REDIS_PATH}|i" /conf/.env
fi
if [ "$REDIS_HOST" != '' ]; then
sed -i "s|REDIS_HOST=.*|REDIS_HOST=${REDIS_HOST}|i" /conf/.env
fi
if [ "$REDIS_PORT" != '' ]; then
sed -i "s|REDIS_PORT=.*|REDIS_PORT=${REDIS_PORT}|i" /conf/.env
fi
if [ "$REDIS_USERNAME" != '' ]; then
sed -i "s|REDIS_USERNAME=.*|REDIS_USERNAME=${REDIS_USERNAME}|i" /conf/.env
fi
if [ "$REDIS_PASSWORD" != '' ]; then
sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=${REDIS_PASSWORD}|i" /conf/.env
elif [ "$REDIS_PASSWORD_FILE" != '' ]; then
value=$(<$REDIS_PASSWORD_FILE)
sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=${value}|i" /conf/.env
fi
if [ "$MAIL_DRIVER" != '' ]; then
replace_or_insert "MAIL_DRIVER" "$MAIL_DRIVER"
fi
Expand Down