diff --git a/Dockerfile b/Dockerfile index 588d8fa09..1f6db8d51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,16 +74,14 @@ COPY --chown=root:www-data --chmod=770 --from=composerbuild /build . COPY --chown=root:www-data --chmod=770 --from=yarnbuild /build/public ./public # Create and remove directories -RUN mkdir -p /pelican-data/storage /pelican-data/plugins /var/run/supervisord \ - && rm -rf /var/www/html/plugins \ -# Symlinks for env, database, storage, and plugins +RUN mkdir -p /pelican-data/storage /var/run/supervisord \ +# Symlinks for env, database, storage && ln -s /pelican-data/.env /var/www/html/.env \ && ln -s /pelican-data/database/database.sqlite ./database/database.sqlite \ && ln -s /pelican-data/storage /var/www/html/public/storage \ && ln -s /pelican-data/storage /var/www/html/storage/app/public \ - && ln -s /pelican-data/plugins /var/www/html \ # Allow www-data write permissions where necessary - && chown -R www-data: /pelican-data .env ./storage ./plugins ./bootstrap/cache /var/run/supervisord /var/www/html/public/storage \ + && chown -R www-data: /pelican-data .env ./storage ./bootstrap/cache /var/run/supervisord /var/www/html/public/storage \ && chmod -R 770 /pelican-data ./storage ./bootstrap/cache /var/run/supervisord \ && chown -R www-data: /usr/local/etc/php/ /usr/local/etc/php-fpm.d/ /var/www/html/composer.json /var/www/html/composer.lock # Configure Supervisor diff --git a/Dockerfile.dev b/Dockerfile.dev index b190151d7..2717d9b14 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -79,16 +79,14 @@ COPY --chown=root:www-data --chmod=770 --from=composerbuild /build . COPY --chown=root:www-data --chmod=770 --from=yarnbuild /build/public ./public # Create and remove directories -RUN mkdir -p /pelican-data/storage /pelican-data/plugins /var/run/supervisord \ - && rm -rf /var/www/html/plugins \ -# Symlinks for env, database, storage, and plugins +RUN mkdir -p /pelican-data/storage /var/run/supervisord \ +# Symlinks for env, database, storage && ln -s /pelican-data/.env /var/www/html/.env \ && ln -s /pelican-data/database/database.sqlite ./database/database.sqlite \ && ln -s /pelican-data/storage /var/www/html/public/storage \ && ln -s /pelican-data/storage /var/www/html/storage/app/public \ - && ln -s /pelican-data/plugins /var/www/html \ # Allow www-data write permissions where necessary - && chown -R www-data: /pelican-data .env ./storage ./plugins ./bootstrap/cache /var/run/supervisord /var/www/html/public/storage \ + && chown -R www-data: /pelican-data .env ./storage ./bootstrap/cache /var/run/supervisord /var/www/html/public/storage \ && chmod -R 770 /pelican-data ./storage ./bootstrap/cache /var/run/supervisord \ && chown -R www-data: /usr/local/etc/php/ /usr/local/etc/php-fpm.d/ /var/www/html/composer.json /var/www/html/composer.lock diff --git a/compose-bind.yml b/compose-bind.yml new file mode 100644 index 000000000..21b810b4f --- /dev/null +++ b/compose-bind.yml @@ -0,0 +1,52 @@ +x-common: + panel: + &panel-environment + APP_URL: "http://localhost" + LE_EMAIL: "USEYOUROWNEMAILHERE@example.com" # email to be used for let's encrypt certificates + APP_DEBUG: "false" + APP_ENV: "production" + + # BEHIND_PROXY: true # uncomment to run behind a proxy + # TRUSTED_PROXIES: 127.0.0.1,172.17.0.1,172.20.0.1 # defaults are for local proxies + + mail: + &mail-environment + MAIL_DRIVER: "log" + # MAIL_HOST: "" + # MAIL_PORT: "" + # MAIL_FROM: "" + # MAIL_USERNAME: "" + # MAIL_PASSWORD: "" + # MAIL_SCHEME: "" + +# +# ------------------------------------------------------------------------------------------ +# DANGER ZONE BELOW +# +# The remainder of this file likely does not need to be changed. Please only make modifications +# below if you understand what you are doing. +# + +services: + panel: + user: "0:0" + image: ghcr.io/pelican-dev/panel:latest + build: . + restart: unless-stopped + networks: + - default + ports: + - "80:80" + - "443:443" + # - "81:80" # if you are behind a proxy uncomment this line and comment out 80 and 443 + # - "9000:9000" # enable when not using caddy to be able to reach php-fpm + extra_hosts: + - "host.docker.internal:host-gateway" # shows the panel on the internal docker network as well. usually '172.17.0.1' + volumes: + - /opt/pelican/data:/pelican-data + - /opt/pelican/logs:/var/www/html/storage/logs + - /opt/pelican/plugins:/var/www/html/plugins + environment: + <<: [*panel-environment, *mail-environment] + XDG_DATA_HOME: /pelican-data + # SKIP_CADDY: true # enable when not using caddy. diff --git a/compose-full-stack.yml b/compose-full-stack.yml index 304f3a93c..9d65856a5 100644 --- a/compose-full-stack.yml +++ b/compose-full-stack.yml @@ -69,6 +69,11 @@ services: volumes: - pelican-data:/pelican-data - pelican-logs:/var/www/html/storage/logs + - type: volume + source: pelican-data + target: /var/www/html/plugins + volume: + subpath: plugins environment: <<: [*panel-environment, *mail-environment] XDG_DATA_HOME: /pelican-data diff --git a/compose.yml b/compose.yml index 86d16c0ef..b04f6e52c 100644 --- a/compose.yml +++ b/compose.yml @@ -44,6 +44,12 @@ services: volumes: - pelican-data:/pelican-data - pelican-logs:/var/www/html/storage/logs + - type: volume + source: pelican-data + target: /var/www/html/plugins + volume: + subpath: plugins + environment: <<: [*panel-environment, *mail-environment] XDG_DATA_HOME: /pelican-data diff --git a/docker/crontab b/docker/crontab index f67a6bf17..e853ba766 100644 --- a/docker/crontab +++ b/docker/crontab @@ -1 +1,2 @@ * * * * * php /var/www/html/artisan schedule:run +0 0 * * * php /var/www/html/artisan p:egg:check-updates \ No newline at end of file