Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #313

Merged
merged 27 commits into from
Sep 27, 2024
Merged

Docker #313

merged 27 commits into from
Sep 27, 2024

Conversation

lancepioch
Copy link
Member

No description provided.

parkervcp

This comment was marked as resolved.

@engels74

This comment was marked as resolved.

@parkervcp

This comment was marked as resolved.

Copy link
Contributor

@parkervcp parkervcp left a comment

Choose a reason for hiding this comment

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

Looks good to me. We should probably fire this up where it's actually on the internet to see how it goes before we fully release it.

We can add more compose files later. Some with all the things needed for redis/valkey and mariadb support.

Caddyfile Outdated Show resolved Hide resolved
@Boy132 Boy132 linked an issue Jun 13, 2024 that may be closed by this pull request
compose.yml Show resolved Hide resolved
@Boy132 Boy132 removed their request for review June 13, 2024 12:59
@lancepioch lancepioch marked this pull request as ready for review June 16, 2024 17:27
@luthes
Copy link

luthes commented Jun 23, 2024

I've been digging into this a bit, both testing the Compose as well as the container builds, and tinkering with Helm. I run entirely in k8s any more, and having everything so tightly coupled in the current Dockerfile causes issues there.

That being said, I was able to split out Caddy and the Panel with Docker Compose (and Helm as well), by simply overriding commands, and editing and mounting the config file. But I do believe the base Dockerfile for the Panel should not bundle Caddy, each component (Caddy, Panel, Redis, etc.) should be it's own service.

From what I've been looking into this evening, what's needed to make this more micro-service friendly is:

  • Use volumes to provide access to /var/www/html files in Compose, rather than COPY . . in the Docker build.
  • Existing Panel Dockerfile should not bundle anything that's not necessary to running php-fpm.
  • Caddyfile needs updated to use Docker overlay network, rather than localhost

Just a note that I'm willing to work on the above if you'd accept a PR. Let me know what you think of the above or if you're looking to go a different direction, happy to help.

@LumiKattlin
Copy link

LumiKattlin commented Jul 23, 2024

On the "composer install --no-dev --optimize-autoloader" part from the docker-compose, after reaching it, it returns the error code 2

This is the logs:

Composer could not detect the root package (pelican-dev/panel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - Root composer.json requires PHP extension ext-pdo_mysql * but it is missing from your system. Install or enable PHP's pdo_mysql extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/conf.d/docker-fpm.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-gd.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-pdo_mysql` to temporarily ignore these required extensions.
The command '/bin/sh -c composer install --no-dev --optimize-autoloader' returned a non-zero code: 2

@parkervcp
Copy link
Contributor

@LumiKattlin did you have this issue while building the container? I just tried out a build and it worked.

Have you tried this recently?

@LumiKattlin
Copy link

Yeah, dw, it ended up being a mistake on my part

ended up working 👍

@VozDeOuro
Copy link

@parkervcp sorry for ping, do you have any ETA on when this will be merged ?

lancepioch and others added 2 commits September 26, 2024 18:29
This reverts commit 649e82d.
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.
@parkervcp
Copy link
Contributor

Well that was ugly

compose.yml Outdated Show resolved Hide resolved
composer.json Show resolved Hide resolved
lancepioch and others added 6 commits September 27, 2024 15:53
Update the dockerfile to use supervisord
Update supervisord config to use start caddy unless configured not to.
Updated entrypoint to handle caddy skip for supervisord.
Copy link
Contributor

@parkervcp parkervcp left a comment

Choose a reason for hiding this comment

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

LGTM

@lancepioch lancepioch merged commit a067419 into main Sep 27, 2024
27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2024
@Boy132 Boy132 deleted the issue/311 branch October 1, 2024 08:21
@pelican-dev pelican-dev deleted a comment from parkervcp Oct 31, 2024
@pelican-dev pelican-dev deleted a comment from github-actions bot Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker image & compose file
6 participants