mirror of
https://github.com/movie-web/docs.git
synced 2025-09-13 14:43:27 +00:00
Initial draft
This commit is contained in:
@@ -1,27 +1,34 @@
|
||||
---
|
||||
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.
|
||||
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](2.configuration.md).
|
||||
|
||||
::alert{type="info"}
|
||||
The postgres database will need to be populated with [migrations](0.introduction.md) if `postgres.migrateOnBoot` isn't enabled.
|
||||
The postgres database will need to be populated with [migrations](0.introduction.md#migrations) if `postgres.migrateOnBoot` isn't enabled.
|
||||
::
|
||||
|
||||
## Method 1 - Docker
|
||||
|
||||
For other versions, [check out the package page](https://github.com/movie-web/backend/pkgs/container/backend).
|
||||
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](2.configuration.md) to customize your experience more thoroughly.
|
||||
|
||||
The command below will not work unless customized by you, change the [`MWB_POSTGRES__CONNECTION`](2.configuration.md#postgresconnection) and [`MWB_CRYPTO__SESSION_SECRET`](2.configuration.md#cryptosessionsecret) to something valid for the backend to function.
|
||||
|
||||
If you're using a hosted postgres database like [Neon](https://neon.tech/){target="\_blank"}, you'll also want to enable SSL support for the backend using the [`postgres.ssl`](2.configuration.md#postgresssl) option.
|
||||
|
||||
For other versions of the image, [check out the package page](https://github.com/movie-web/backend/pkgs/container/backend){target="\_blank"}.
|
||||
|
||||
```sh
|
||||
docker run \
|
||||
-p 80:80 \
|
||||
-e POSTGRES__CONNECTION=postgresql://localhost:5432 \
|
||||
-e CRYPTO__SESSION_SECRET=add-your-own-secret \
|
||||
-e META__NAME=unofficial-movie-web \
|
||||
-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_](../1.self-hosting/4.troubleshooting.md) 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.
|
||||
|
Reference in New Issue
Block a user