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

New docker setup #1085

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft

New docker setup #1085

wants to merge 45 commits into from

Conversation

melroy89
Copy link
Member

@melroy89 melroy89 commented Sep 4, 2024

Follow-up from: #1021

  • Testing
  • Introduce an internal network (do not expose ports like PostgreSQL to the host) for services that can stay internal
  • ...

LoveIsGrief added 30 commits September 4, 2024 11:32
It's the latest at the time of this commit
It should be using the entrypoint from the image
symfony/symfony#34660
Symfony devs always force the use of a `.env` file even if the env
is set properly.
The cleanest is thus to have an empty `.env` and pass the real env
to the container.
curl isn't installed in the image and the health check
was constantly failing
/public files are copied into a common volume shared between reverse proxy and PHP-FPM service.
Otherwise the logs get filled with 'FATAL:  role "root" does not exist' everytime the health is checked
After supporting arbitrary reverse proxies, media uploads were broken.
They are uploaded to public/media/ by `php` service, but the previous solution just provided a copy
of public/media/ at first run. New uploads weren't shared with the `www` service.

Now, instead of just providing a copy, a mount is provided. To do so the strategy was changed and a lead taken
out of nextcloud's book: https://github.com/nextcloud/docker/blob/65138b6d22bec1ac15e2f0f125426290640bb97a/docker-entrypoint.sh

**The problem**

The image had the mbin sources in /var/www/mbin. Mounting docker/storage/public into /var/www/mbin/public would
replace the image's public/ with a (hitherto) empty directory.

**The solution**

The image has its sources in /usr/src/mbin and on startup, syncs that into the new mount /var/www/mbin using `rsync`.
In this manner, previous uploads are preserved and source changes update /var/www/mbin.
Separate images are now available because mbin isn't solely bound to caddy and can be used with any reverse proxy.
These come due to the refactoring:

 - `docker/compose.yml` --> `/compose.yml`
 - support for arbitrary reverse proxies without running caddy
 - smaller docker image
 - allow overrides without changing versioned files
@melroy89 melroy89 added enhancement New feature or request docker Issues and pull requests related to docker environment labels Sep 4, 2024
@@ -107,6 +111,10 @@ EXIF_EXIFTOOL_PATH=
# max execution time for exiftool in seconds, defaults to 10 seconds
EXIF_EXIFTOOL_TIMEOUT=10

###> caddy ###
PHP_FASTCGI_HOST=php:9000
Copy link
Member Author

Choose a reason for hiding this comment

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

This shouldn't be here.

@@ -31,6 +31,10 @@ KBIN_META_KEYWORDS="mbin, content aggregator, open source, fediverse"
KBIN_HEADER_LOGO=false
KBIN_FEDERATION_PAGE_ENABLED=true
MBIN_DEFAULT_THEME=default
MBIN_HOME=/var/www/mbin
Copy link
Member Author

Choose a reason for hiding this comment

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

These en vars shouldn't be here as well ideally put these in the compose override yaml file.

Copy link
Contributor

This PR is stale because it has been open 40 days with no activity.

@github-actions github-actions bot added the Stale Inactivity for too long label Oct 19, 2024
@github-actions github-actions bot removed the Stale Inactivity for too long label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Issues and pull requests related to docker environment enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant