-
Notifications
You must be signed in to change notification settings - Fork 17
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
melroy89
wants to merge
46
commits into
main
Choose a base branch
from
new_docker_setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
New docker setup #1085
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
51317a2
chore(docker): add .env to redis and db services
f92c58a
chore: make docker runnable as dev app
e75466d
rework docker for dev
c83485b
wip: split compose.yml
d0053cd
Add TODO for prod entrypoint
3094794
Use .env.dev_docker in compose.dev.yml
e39052b
Simplify dev docker compose
6f41aec
tick off docker internal host linux
4596cb2
chore(docker): add app.ini to compose.dev.yml
9ba6bef
chore(docker): remove unnecessary comment
f352c2f
chore: add replicas to messenger service in compose.prod.yml
bf23ce6
chore: upgrade postgres to v16
1d279e0
wip: semi-function production images
f9d4a17
refactor: remove `set -x` in docker entrypoint
8e9f9c8
refactor(compose): don't mount entrypoint into prod
43377ff
refactor(docker): use dummy .env for prod Dockerfile
b003496
fix(docker): use wget to check www health
2fccae4
Support running mbin behind any reverse proxy
5b12728
Fix docker dev after making it work for prod
968381f
Add documentation docker env
96dc91d
Comments + remove unnecessary mounts from prod compose
b59f67c
fix: call pg_isready with user variable
2cd5b58
rm notes.md
86d6ae7
fix(docker): support uploading media
e4d27ce
chore: remove unused file
427a86c
chore(doc): document overriding in dev docker env
ff25214
chore(gh-actions): Publish PHP and caddy images
1999588
chore(docker): Update docs for production
37b9705
fix(docker): do not expose rabbitmq port to the world in production
1e03b83
chore(doc): Add link to development environment in CONTRIBUTING.md
fa8616f
refactor(docker): remove unnecessary networks from compose.prod.yml
26127f0
chore(docker): Update nodejs image to 22.7.0
9da2e85
chore(docker): docker-compose does actually work :O
58014b1
Fix typos in docs/04-contributing/development_environment.md
25578c7
Fix more typos in docs/04-contributing/development_environment.md
ca668e0
chore(docker): Reference PHP8.3 in development_environment.md
585ae55
refactor(docker): remove unnecessary `pwd` from entrypoint.sh
3e5e1ef
chore(docker): Remove warning about nginx config
7466547
fix(docker): Depend on /.env and add instructions
bea9c07
chore(docs): Split development_environment.md in two
2d79a3b
chore(docs): Replace bold single lines with headers
6c10103
chore(docs): update docs/04-contributing/docker.md title
97ec77d
refactor(docker): Use 8008 for www service in prod too
12944ce
Merge branch 'main' into new_docker_setup
melroy89 ecbce87
Merge branch 'main' into new_docker_setup
melroy89 80983ea
Merge branch 'main' into new_docker_setup
melroy89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
# In all environments, the following files are loaded if they exist, | ||
# the latter taking precedence over the former: | ||
# | ||
# * .env contains default values for the environment variables needed by the app | ||
# * .env.local uncommitted file with local overrides | ||
# * .env.$APP_ENV committed environment-specific defaults | ||
# * .env.$APP_ENV.local uncommitted environment-specific overrides | ||
# | ||
# Real environment variables win over .env files. | ||
# | ||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. | ||
# | ||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). | ||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration | ||
|
||
# Mbin variables | ||
SERVER_NAME=:80 | ||
KBIN_DOMAIN=127.0.0.1:8008 | ||
KBIN_TITLE=Mbin | ||
KBIN_DEFAULT_LANG=en | ||
KBIN_FEDERATION_ENABLED=true | ||
[email protected] | ||
[email protected] | ||
KBIN_JS_ENABLED=true | ||
KBIN_REGISTRATIONS_ENABLED=true | ||
KBIN_API_ITEMS_PER_PAGE=25 | ||
KBIN_STORAGE_URL=http://127.0.0.1:8000/media | ||
KBIN_META_TITLE="Mbin" | ||
KBIN_META_DESCRIPTION="content aggregator, content voting, discussion and micro-blogging platform on the fediverse" | ||
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 | ||
MBIN_USER=mbin | ||
MBIN_GROUP=www-data | ||
|
||
# If you are running Mbin behind a reverse proxy, uncomment the line below and adjust the proxy address/range below | ||
# to your server's IP address if it does not already fall within the private IP spaces specified. | ||
TRUSTED_PROXIES=::1,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 | ||
#TRUSTED_PROXIES= | ||
|
||
# Max image filesize (in bytes) | ||
# This should be set to <= `upload_max_filesize` and `post_max_size` in the server's php.ini file | ||
MAX_IMAGE_BYTES=6000000 | ||
|
||
# Captcha (also enable in admin panel/settings) | ||
KBIN_CAPTCHA_ENABLED=false | ||
|
||
###> meteo-concept/hcaptcha-bundle ### | ||
HCAPTCHA_SITE_KEY= | ||
HCAPTCHA_SECRET= | ||
###< meteo-concept/hcaptcha-bundle ### | ||
|
||
# Redis | ||
REDIS_PASSWORD=!ChangeThisRedisPass! | ||
REDIS_DNS=redis://${REDIS_PASSWORD}@redis:6379 | ||
|
||
# S3 storage (optional) | ||
S3_KEY= | ||
S3_SECRET= | ||
S3_BUCKET= | ||
S3_REGION= | ||
S3_ENDPOINT= | ||
S3_VERSION= | ||
|
||
# Only let admins generate oauth clients | ||
KBIN_ADMIN_ONLY_OAUTH_CLIENTS=false | ||
|
||
# oAuth (optional) | ||
OAUTH_AZURE_ID= | ||
OAUTH_AZURE_SECRET= | ||
# If you want people from an enterprise to connect your instance, set the tenant id here. | ||
# If you want people from anywhere to connect with either their personnal or professionnal microsoft account, use "common" | ||
OAUTH_AZURE_TENANT= | ||
OAUTH_FACEBOOK_ID= | ||
OAUTH_FACEBOOK_SECRET= | ||
OAUTH_GOOGLE_ID= | ||
OAUTH_GOOGLE_SECRET= | ||
OAUTH_DISCORD_ID= | ||
OAUTH_DISCORD_SECRET= | ||
OAUTH_GITHUB_ID= | ||
OAUTH_GITHUB_SECRET= | ||
OAUTH_KEYCLOAK_ID= | ||
OAUTH_KEYCLOAK_SECRET= | ||
OAUTH_KEYCLOAK_URI= | ||
OAUTH_KEYCLOAK_REALM= | ||
OAUTH_KEYCLOAK_VERSION= | ||
OAUTH_SIMPLELOGIN_ID= | ||
OAUTH_SIMPLELOGIN_SECRET= | ||
OAUTH_ZITADEL_ID= | ||
OAUTH_ZITADEL_SECRET= | ||
OAUTH_ZITADEL_BASE_URL= | ||
OAUTH_AUTHENTIK_ID= | ||
OAUTH_AUTHENTIK_SECRET= | ||
OAUTH_AUTHENTIK_BASE_URL= | ||
OAUTH_PRIVACYPORTAL_ID= | ||
OAUTH_PRIVACYPORTAL_SECRET= | ||
|
||
# If true, sign ins and sign ups will only be possible through the OAuth providers configured above | ||
SSO_ONLY_MODE= | ||
|
||
# image exif cleaning options | ||
# available value: none, sanitize, scrub | ||
# can be set differently for user uploaded and external media | ||
EXIF_CLEAN_MODE_UPLOADED=sanitize | ||
EXIF_CLEAN_MODE_EXTERNAL=none | ||
# path to exiftool binary, leave blank for auto PATH search | ||
EXIF_EXIFTOOL_PATH= | ||
# max execution time for exiftool in seconds, defaults to 10 seconds | ||
EXIF_EXIFTOOL_TIMEOUT=10 | ||
|
||
###> caddy ### | ||
PHP_FASTCGI_HOST=php:9000 | ||
###< caddy ### | ||
|
||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=427f5e2940e5b2472c1b44b2d06e0525 | ||
###< symfony/framework-bundle ### | ||
|
||
###> doctrine/doctrine-bundle ### | ||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url | ||
POSTGRES_HOST=db:5432 | ||
POSTGRES_DB=mbin | ||
POSTGRES_USER=mbin | ||
POSTGRES_PASSWORD=!ChangeThisPostgresPass! | ||
# IMPORTANT: You MUST configure your PostgreSQL server version! | ||
POSTGRES_VERSION=16 | ||
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=utf8" | ||
###< doctrine/doctrine-bundle ### | ||
|
||
###> rabbitmq ### | ||
RABBITMQ_DEFAULT_USER=mbin | ||
RABBITMQ_DEFAULT_PASS=!ChangeThisRabbitPass! | ||
###< rabbitmq ### | ||
|
||
###> symfony/messenger ### | ||
# Choose one of the transports below | ||
MESSENGER_TRANSPORT_DSN=amqp://mbin:${RABBITMQ_DEFAULT_PASS}@rabbitmq:5672/%2f/messages | ||
#MESSENGER_TRANSPORT_DSN=doctrine://default | ||
#MESSENGER_TRANSPORT_DSN=redis://${REDIS_PASSWORD}@${REDIS_HOST}/messages | ||
###< symfony/messenger ### | ||
|
||
###> symfony/mailer ### | ||
# See https://symfony.com/doc/current/mailer.html#using-built-in-transports | ||
# MAILER_DSN=sendmail://default # Use sendmail when you are using Postfix | ||
MAILER_DSN=smtp://mailserver # Use a SMTP Docker service called 'mailserver' (see compose.yml) | ||
# Explicitly url encode any character in username and password | ||
# %40 = @ | ||
# Gmail: | ||
# MAILER_DSN=gmail+smtp://user%40domain.com:pass@default | ||
# Our own SMTP server: | ||
# MAILER_DSN=smtp://user%40domain.com:[email protected]:port | ||
###< symfony/mailer ### | ||
|
||
###> symfony/mailgun-mailer ### | ||
# MAILER_DSN=mailgun://KEY:DOMAIN@default?region=us | ||
# MAILER_DSN=mailgun+smtp://[email protected]:key@default?region=us | ||
###< symfony/mailgun-mailer ### | ||
|
||
###> symfony/mercure-bundle ### | ||
# See https://symfony.com/doc/current/mercure.html#configuration | ||
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL) | ||
# Assuming you are running Mercure Caddy on port 3000 | ||
MERCURE_URL=http://www:80/.well-known/mercure | ||
# The public URL of the Mercure hub, used by the browser to connect | ||
MERCURE_PUBLIC_URL=https://${KBIN_DOMAIN}/.well-known/mercure | ||
# The secret used to sign the JWTs | ||
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!" | ||
MERCURE_PUBLISHER_JWT_KEY=${MERCURE_JWT_SECRET} | ||
MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_JWT_SECRET} | ||
###< symfony/mercure-bundle ### | ||
|
||
###> nelmio/cors-bundle ### | ||
CORS_ALLOW_ORIGIN="^https?://(${KBIN_DOMAIN}|127\.0\.0\.1)(:[0-9]+)?$" | ||
###< nelmio/cors-bundle ### | ||
|
||
###> symfony/lock ### | ||
# Choose one of the stores below | ||
# postgresql+advisory://db_user:db_password@localhost/db_name | ||
LOCK_DSN=flock | ||
###< symfony/lock ### | ||
|
||
###> league/oauth2-server-bundle ### | ||
OAUTH_PRIVATE_KEY= | ||
OAUTH_PUBLIC_KEY= | ||
OAUTH_PASSPHRASE= | ||
OAUTH_ENCRYPTION_KEY= | ||
###< league/oauth2-server-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
MBIN_SRC=/usr/src/mbin | ||
MBIN_USER=mbin | ||
MBIN_GROUP=www-data | ||
|
||
# If you are running Mbin behind a reverse proxy, uncomment the line below and adjust the proxy address/range below | ||
# to your server's IP address if it does not already fall within the private IP spaces specified. | ||
|
@@ -113,6 +117,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be here. |
||
###< caddy ### | ||
|
||
###> symfony/framework-bundle ### | ||
APP_ENV=prod | ||
APP_SECRET=!CHANGE_SECRET! | ||
|
@@ -121,18 +129,22 @@ APP_SECRET=!CHANGE_SECRET! | |
###> doctrine/doctrine-bundle ### | ||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url | ||
POSTGRES_HOST=db:5432 | ||
POSTGRES_DB=kbin | ||
POSTGRES_USER=kbin | ||
POSTGRES_DB=mbin | ||
POSTGRES_USER=mbin | ||
POSTGRES_PASSWORD=!ChangeThisPostgresPass! | ||
# IMPORTANT: You MUST configure your PostgreSQL server version! | ||
POSTGRES_VERSION=13 | ||
POSTGRES_VERSION=16 | ||
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=utf8" | ||
###< doctrine/doctrine-bundle ### | ||
|
||
###> rabbitmq ### | ||
RABBITMQ_DEFAULT_USER=mbin | ||
RABBITMQ_DEFAULT_PASS=!ChangeThisRabbitPass! | ||
###< rabbitmq ### | ||
|
||
###> symfony/messenger ### | ||
# Choose one of the transports below | ||
RABBITMQ_PASSWORD=!ChangeThisRabbitPass! | ||
MESSENGER_TRANSPORT_DSN=amqp://kbin:${RABBITMQ_PASSWORD}@rabbitmq:5672/%2f/messages | ||
MESSENGER_TRANSPORT_DSN=amqp://mbin:${RABBITMQ_DEFAULT_PASS}@rabbitmq:5672/%2f/messages | ||
#MESSENGER_TRANSPORT_DSN=doctrine://default | ||
#MESSENGER_TRANSPORT_DSN=redis://${REDIS_PASSWORD}@${REDIS_HOST}/messages | ||
###< symfony/messenger ### | ||
|
@@ -163,6 +175,8 @@ MERCURE_URL=http://www:80/.well-known/mercure | |
MERCURE_PUBLIC_URL=https://${KBIN_DOMAIN}/.well-known/mercure | ||
# The secret used to sign the JWTs | ||
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!" | ||
MERCURE_PUBLISHER_JWT_KEY=${MERCURE_JWT_SECRET} | ||
MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_JWT_SECRET} | ||
###< symfony/mercure-bundle ### | ||
|
||
###> nelmio/cors-bundle ### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.