-
Notifications
You must be signed in to change notification settings - Fork 30
Rework docker setup #1542
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
Rework docker setup #1542
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Melroy van den Berg <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
I think it's really ready this time! Of course, if I find anything else, I'll just make another PR. Once this is merged, I'm going to put it on kbin.earth. That will be the real test! |
Yeah! I'm really happy with this! Thank you so much! |
Changes to Docker setup
.envandcompose.override.yamlfiles are now stored in the root of the Mbin directory, with all other server specific data stored instorage/(including OAuth keys).kbintombin.17.S3_KEYis provided.301status code) by default.Quick Start Guide
Use these steps to install Mbin on a new server. It is assumed that docker is already installed and set up.
git clone https://github.com/MbinOrg/mbin.git && cd mbin(make sure to switch to this docker branch)../docker/setup.sh prod DOMAINHERE(uselocalhostfor the domain if you want to test locally)..env.docker build -t mbin -f docker/Dockerfile .to build the Docker image.docker compose up -dto start the Docker containers.80and443allowed) are correctly configured, then you should be able to access your new Mbin instance from your domain (or https://localhost_ if you usedlocalhost)!Migration Guide
Use these steps to migrate from the old Docker setup to this one. The big thing to keep in mind is that all your server data is now in one of three locations:
.env,compose.override.yaml, andstorage/. So, all server data will be going under here from now on.Additionally, this new setup does not require a reverse proxy (and actually recommends not using one), as the PHP server it's using comes with built-in HTTPS support via Let's Encrypt and Caddy. You will need to ensure ports
80and443are directly exposed and available on your server in order for this migration guide to work.git clone https://github.com/MbinOrg/mbin.git)! I'll referenceoldas your old Mbin directory andnewas your new one.new(with this docker branch of course):./docker/setup.sh prod DOMAINHERE.docker compose downinold/dockerif you haven't already.old/docker/storage/postgrestonew/storage/postgres.old/docker/storage/mediatonew/storage/media.old/config/oauth2tonew/storage/oauth(bothprivate.pemandpublic.pem).old/docker/.envandnew/.envside by side so you can copy values from the old.envfile to the new one as needed..envvalues, includingKBIN_*,MBIN_*,MAX_IMAGE_BYTES,HCAPTCHA_*,S3_*, the SSO fields,EXIF_*,APP_SECRET,POSTGRES_*,MAILER_DSN,MERCURE_JWT_SECRET,OAUTH_PASSPHRASE, andOAUTH_ENCRYPTION_KEY. Everything else, you can leave alone; feel free to ask if you have any questions about this.new/storage/to matchMBIN_USERin.env. Runchown -R 1000:1000 new/storage/if yourMBIN_USERis1000:1000. Running the new setup under root has not been tested yet, but you will likely not need to change any file permissions if you were running as root previously.new/compose.override.yaml, uncomment the section that enables you to build the Docker image locally.new, rundocker compose up -dto build and start the Docker containers.To Do
compose.override.yamlinstead ofcompose.prod.yamlto use the prebuilt image.