docs/content/3.client/1.deploy.md

126 lines
5.4 KiB
Markdown
Raw Normal View History

2023-12-12 18:36:07 +00:00
---
title: 'Deploy'
---
2023-12-31 14:39:55 +00:00
2023-12-12 18:25:35 +00:00
# Deploying the client
## Method 1 - Vercel - Recommended
2023-12-31 14:39:55 +00:00
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmovie-web%2Fmovie-web%2Ftree%2Fmaster&env=VITE_CORS_PROXY_URL,VITE_TMDB_READ_API_KEY)
2023-12-31 14:39:55 +00:00
1. Click the Deploy button.
1. Sign in using either a GitHub, GitLab, or Bitbucket.
1. Follow the instructions to create a repository for movie-web.
1. Configure the environment variables:
2023-12-31 14:39:55 +00:00
- `VITE_CORS_PROXY_URL`: Enter your proxy URL here. Make sure to not have a slash at the end of your URL.
2023-12-31 14:39:55 +00:00
Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `https://test-proxy.test.workers.dev`
2023-12-31 14:39:55 +00:00
- `VITE_TMDB_READ_API_KEY`: Enter your TMDB Read Access Token here. Please read [the TMDB page](2.tmdb.md) on how to get an API key.
2023-12-12 18:25:35 +00:00
- `VITE_BACKEND_URL`: Only set if you have a self-hosted backend. Put in your backend URL. Check out [configuration reference](../4.client/2.configuration.md) for details. Make sure to not have a slash at the end of the URL.
2023-12-31 14:39:55 +00:00
1. Click "Deploy"
1. Congrats! You have your own version of movie-web hosted.
1. You may wish to configure a custom domain - Please consult [the Vercel docs for how to do this](https://vercel.com/docs/getting-started-with-vercel/domains).
2023-12-12 18:25:35 +00:00
## Method 2 - Static Web Host
2023-12-31 14:39:55 +00:00
1. Download the file `movie-web.zip` from the latest release: https://github.com/movie-web/movie-web/releases/latest.
2. Extract the ZIP file so you can edit the files.
3. Open `config.js` in an editor such as Notepad, Visual Studio Code or similar.
4. Put your proxy URL in-between the double quotes of `VITE_CORS_PROXY_URL: ""`. Make sure to not have a slash at the end of your URL.
2023-12-12 18:25:35 +00:00
Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `VITE_CORS_PROXY_URL: "https://test-proxy.test.workers.dev"`
2023-12-31 14:39:55 +00:00
5. Put your TMDB Read Access Token inside the quotes of `VITE_TMDB_READ_API_KEY: ""`. Please read [the TMDB page](2.tmdb.md) on how to get an API key.
6. If you have a self-hosted backend server, enter your URL in the `VITE_BACKEND_URL` variable. Check out [configuration reference](../4.client/2.configuration.md) for details. Make sure to not have a slash at the end of the URL.
2023-12-31 14:39:55 +00:00
7. Save the file.
8. Upload **all** of the files to a static website hosting such as:
- GitHub Pages
- Netlify
- Vercel
2023-12-31 14:39:55 +00:00
- Etc, [there are lots of options](https://www.staticwebsitehosting.org/){target="\_blank"}.
9. Congrats! You have your own version of movie-web hosted.
## Method 3 - Docker Compose - Home Network
2024-03-01 00:35:02 +00:00
This method is meant for those using a desktop device or single board computer with a minimum of 4GB of RAM such as a [Raspberry Pi](https://www.raspberrypi.com/) to run movie-web on there home network for network connected devices.
1. Ensure you have [docker](https://docs.docker.com/get-docker/) installed. In a newly created directory called `movie-web` create a file called `docker-compose.yaml`. Paste the contents of the code block below into this file.
```yaml
version: "3.8"
services:
movieweb:
build:
context: https://github.com/movie-web/movie-web.git
# args:
# PWA_ENABLED: "false"
# GA_ID: ""
# APP_DOMAIN: ""
# OPENSEARCH_ENABLED: "false"
# TMDB_READ_API_KEY: ""
# CORS_PROXY_URL: ""
# DMCA_EMAIL: ""
# NORMAL_ROUTER: "false"
# BACKEND_URL: ""
# HAS_ONBOARDING: "false"
# ONBOARDING_CHROME_EXTENSION_INSTALL_LINK: ""
# ONBOARDING_PROXY_INSTALL_LINK: ""
# DISALLOWED_IDS: ""
# CDN_REPLACEMENTS: ""
# TURNSTILE_KEY: ""
ports:
- "80:80"
restart: unless-stopped
```
2024-03-01 00:35:02 +00:00
2. Within the `docker-compose.yaml` file uncomment `args`, `TMDB_READ_API_KEY`, `CORS_PROXY_URL`.
- Make sure `args` is in-line with `context`
- Make sure `TMDB_READ_API_KEY` and `CORS_PROXY_URL` are tabbed once to the right of `args`.
2024-03-01 00:35:02 +00:00
3. Put your proxy URL in-between the double quotes of `CORS_PROXY_URL: ""`. Make sure to not have a slash at the end of your URL.
2024-03-01 00:35:02 +00:00
Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `CORS_PROXY_URL: "https://test-proxy.test.workers.dev"`
2024-03-01 00:35:02 +00:00
4. Put your TMDB Read Access Token inside the quotes of `TMDB_READ_API_KEY: ""`. Please read [the TMDB page](2.tmdb.md) on how to get an API key.
5. Uncomment and add any [additional environment variables](3.configuration.md) you may need.
6. Save the file!
7. Now use [docker](https://docs.docker.com/get-docker/) to run `movieweb` as background service.
```bash
2024-03-01 00:35:02 +00:00
# movie-web is the current working directory
$ docker compose up -d
```
2024-03-01 00:35:02 +00:00
8. Verify that setup was successful
- Navigate to `http://localhost`. You should see the UI for `movie-web`. Find something to watch and make sure that it plays.
- View logs with
```bash
$ docker compose logs --follow movieweb
```
2024-03-01 00:35:02 +00:00
9. Set a static IP address for your device.
- For Raspberry Pi: [guide](https://www.makeuseof.com/raspberry-pi-set-static-ip/)
- For Mac: [guide](https://www.macinstruct.com/tutorials/how-to-set-a-static-ip-address-on-a-mac/)
- For Windows: [guide](https://www.pcmag.com/how-to/how-to-set-up-a-static-ip-address)
2024-03-01 00:35:02 +00:00
10. Navigate to movie web at `http://<static-ip-address` from another device connected to your network.
### To Perform Updates For New Releases of Movie Web
1. Make sure `movie-web` is your current working directory and run:
```bash
# Stop the running container
$ docker compose stop
# Remove the stopped container
$ docker compose rm
# Re-build the image and start the container
$ docker compose up -d
```