add ability to skip starting caddy

dockerfile
  cmd updated to just start php-fpm

entrypoint
  now starts caddy unless SKIP_CADDY has been set.

compose file
  updated ports to work properly.
  updated networks to use the correct network.
  added commented port and variable to disable caddy
  added further notes.
This commit is contained in:
Michael Parker 2024-06-27 15:59:07 -04:00 committed by Michael (Parker) Parker
parent 4fc8d98a0f
commit 6f15537d77
3 changed files with 16 additions and 5 deletions

View File

@ -42,6 +42,13 @@ php artisan migrate --force
echo -e "Starting cron jobs."
crond -L /var/log/crond -l 5
if [[ -z $SKIP_CADDY ]]; then
echo "Starting PHP-FPM and Caddy"
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile &
else
echo "Starting PHP-FPM only"
fi
#chmod -R 755 storage/* bootstrap/cache/
chown -R www-data:www-data .

View File

@ -50,7 +50,7 @@ EXPOSE 443
VOLUME /pelican-data
# Start PHP-FPM
CMD ["sh", "-c", "php-fpm & caddy run --config /etc/caddy/Caddyfile --adapter caddyfile"]
CMD ["sh", "-c", "php-fpm"]
ENTRYPOINT [ "/bin/ash", ".github/docker/entrypoint.sh" ]
# CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]

View File

@ -1,7 +1,7 @@
x-common:
panel:
&panel-environment
APP_URL: "https://localhost"
APP_URL: "https://localhost" # can be set to 'http://localhost' to un on port 80 only
APP_DEBUG: "false"
ADMIN_EMAIL: "USEYOUROWNEMAILHERE@example.com"
@ -29,19 +29,23 @@ x-common:
services:
panel:
image: panel
image: ghcr.io/pelican-dev/panel:latest
restart: always
networks:
- default
ports:
- "80:2019"
- "80:80"
- "443:443"
# - "9000:9000" # enable when not using caddy to be abel to reach php-fpm
extra_hosts:
- "host.docker.internal:host-gateway"
- "host.docker.internal:host-gateway" # shows the panel on te internal docker network as well. usually '172.17.0.1'
volumes:
- pelican-data:/pelican-data
- pelican-logs:/var/www/html/storage/logs
environment:
<<: [*panel-environment, *mail-environment]
XDG_DATA_HOME: /pelican-data
# SKIP_CADDY: true # enable when not using caddy.
volumes:
pelican-data: