docs/content/4.backend/1.deploy.md

1.8 KiB

title
Deploy

Deploying the backend

The only officially recognized hosting method is through Docker (or similar container runtimes). It can be scaled horizontally to all your heart's content and is the safest way to host the backend.

For configuration, check out the configuration reference.

::alert{type="info"} The postgres database will need to be populated with migrations if postgres.migrateOnBoot isn't enabled. ::

Method 1 - Docker

This method will help you set up the backend with the bare minimum configuration options. You'll most likely want to add some more environment variables to customize your experience more thoroughly.

The command below will not work unless customized by you, change the MWB_POSTGRES__CONNECTION and MWB_CRYPTO__SESSION_SECRET to something valid for the backend to function.

If you're using a hosted postgres database like Neon{target="_blank"}, you'll also want to enable SSL support for the backend using the postgres.ssl option.

For other versions of the image, check out the package page{target="_blank"}.

docker run \
    -p 80:80 \
    -e MWB_POSTGRES__CONNECTION=postgresql://localhost:5432 \
    -e MWB_CRYPTO__SESSION_SECRET=add-your-own-secret \
    -e MWB_META__NAME=unofficial-movie-web \
    ghcr.io/movie-web/backend:latest

After running that command, your backend should now be available on localhost:80. if you want to be able to connect to the backend outside of your local network (for example sharing it with your friends), then you'll need set up to port forwarding.