From a7bf9aeb6ffb062086a9495bfca125b1b0b082db Mon Sep 17 00:00:00 2001 From: Pokey <79169880+Pokeylooted@users.noreply.github.com> Date: Wed, 20 Mar 2024 02:50:04 -0500 Subject: [PATCH 1/5] Created 2.selfhost.md Added a docker compose file that hosted all of movie-web --- content/5.extra/2.selfhost.md | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 content/5.extra/2.selfhost.md diff --git a/content/5.extra/2.selfhost.md b/content/5.extra/2.selfhost.md new file mode 100644 index 0000000..f67e471 --- /dev/null +++ b/content/5.extra/2.selfhost.md @@ -0,0 +1,99 @@ +### Guide to full Self-Deployment of Movie-Web with Docker Compose + +1. **Install Docker and Docker Compose:** + + Ensure that Docker and Docker Compose are installed on your system. You can follow the official Docker documentation for installation instructions: + - [Install Docker](https://docs.docker.com/get-docker/) + +2. **Create a Docker Compose file:** + + Create a new file named `docker-compose.yml` in your project directory and paste the following content into it: + + ```yaml + version: '3.8' + + services: + postgres: + image: postgres + restart: unless-stopped + environment: + POSTGRES_USER: movie_web_user + POSTGRES_DB: movie_web_backend + POSTGRES_PASSWORD: YourPasswordHere + ports: + - "5432:5432" + networks: + - movie-web-network + + movie-web: + image: ghcr.io/movie-web/backend:latest + restart: unless-stopped + environment: + MWB_SERVER__CORS: "https://movie-backend.exorbgn.net https://movie.exorbgn.net http://10.2.6.8:80" + MWB_SERVER__PORT: 8080 + MWB_POSTGRES__CONNECTION: postgresql://movie_web_user:YourPasswordHere@postgres:5432/movie_web_backend + MWB_CRYPTO__SESSION_SECRET: 32CHARACTERLONGSECRET + MWB_META__NAME: Server name + MWB_META__DESCRIPTION: Server Description + MWB_POSTGRES__MIGRATE_ON_BOOT: "true" + MWB_SERVER__TRUSTPROXY: "true" + MWB_SERVER__TRUSTCLOUDFLARE: "true" + ports: + - "8080:8080" + depends_on: + - postgres + networks: + - movie-web-network + + movie-web-frontend: + build: + context: https://github.com/movie-web/movie-web.git + args: + TMDB_READ_API_KEY: "YourTMDBReadAPIKeyHere" + CORS_PROXY_URL: "https://cors.example.tld https://second.cors.example.tld" + BACKEND_URL: "https://backend.example.tld" + DMCA_EMAIL: "YourEmail" + PWA_ENABLED: "true" + APP_DOMAIN: "YourDomainHere" + OPENSEARCH_ENABLED: "true" + GA_ID: "Google ID Here" + ports: + - "80:80" + networks: + - movie-web-network + restart: unless-stopped + + movie-web-proxy: + image: ghcr.io/movie-web/simple-proxy:2.1.4 + ports: + - "3000:3000" + networks: + - movie-web-network + restart: unless-stopped + + networks: + movie-web-network: + driver: bridge + + **Important:** + * Replace `YourPasswordHere` with your secure database password. + * Generate a strong session secret and replace `32CharacterLongStringHere`. + ``` + **Important:** + * Replace `YourPasswordHere` with your secure database password. + * Generate a strong session secret and replace `32CharacterLongStringHere`. + * Replace `TMDBReadAPIKey` with your api key learn more [here](https://movie-web.github.io/docs/client/tmdb). + * replace `yourDomainHere` with whatever you'll be using to access your main site, like movie-web.app + * replace `meta__name` and `meta__description` +2. **Start the Backend:** Open a terminal in the directory containing `docker-compose.yml` and execute: + + ```bash + docker compose up --detach + ``` +**Accessing Your Backend** + +Your services should be accessible on `(YourPrivateIP):port`. To share it outside your local network, you'll need to configure port forwarding or cloudflared tunnel. + +**Optional: Implementing a Reverse Proxy** + +To enhance your SSL and domain configuration, it's advisable to establish a reverse proxy, such as Nginx. For an optimal choice in this regard, Cloudflare Zero Trust Tunnel is recommended. You can find more information [here](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/). From 4c3cea00b40d83d432bc920bcefe486e081052bc Mon Sep 17 00:00:00 2001 From: Pokey <79169880+Pokeylooted@users.noreply.github.com> Date: Wed, 20 Mar 2024 02:55:40 -0500 Subject: [PATCH 2/5] Update 2.selfhost.md - changed to example.tld rather than what it was before Changed the domain to example.tld --- content/5.extra/2.selfhost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/5.extra/2.selfhost.md b/content/5.extra/2.selfhost.md index f67e471..3f604cb 100644 --- a/content/5.extra/2.selfhost.md +++ b/content/5.extra/2.selfhost.md @@ -29,7 +29,7 @@ image: ghcr.io/movie-web/backend:latest restart: unless-stopped environment: - MWB_SERVER__CORS: "https://movie-backend.exorbgn.net https://movie.exorbgn.net http://10.2.6.8:80" + MWB_SERVER__CORS: "https://movie-backend.example.tld https://movie.example.tld" MWB_SERVER__PORT: 8080 MWB_POSTGRES__CONNECTION: postgresql://movie_web_user:YourPasswordHere@postgres:5432/movie_web_backend MWB_CRYPTO__SESSION_SECRET: 32CHARACTERLONGSECRET From a75a04a69e99f4975c05ca07c987b45cd5765e37 Mon Sep 17 00:00:00 2001 From: Pokey <79169880+Pokeylooted@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:52:46 -0500 Subject: [PATCH 3/5] type errors/5.extra/2.selfhost.md Co-authored-by: William Oldham --- content/5.extra/2.selfhost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/5.extra/2.selfhost.md b/content/5.extra/2.selfhost.md index 3f604cb..c987e55 100644 --- a/content/5.extra/2.selfhost.md +++ b/content/5.extra/2.selfhost.md @@ -1,4 +1,4 @@ -### Guide to full Self-Deployment of Movie-Web with Docker Compose +### Guide to full Self-Deployment of movie-web with Docker Compose 1. **Install Docker and Docker Compose:** From d702599959ad727885a36d6ff1fedd1b2163dea5 Mon Sep 17 00:00:00 2001 From: Pokey <79169880+Pokeylooted@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:53:56 -0500 Subject: [PATCH 4/5] Update content/5.extra/2.selfhost.md added -backend to movie-web Co-authored-by: William Oldham --- content/5.extra/2.selfhost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/5.extra/2.selfhost.md b/content/5.extra/2.selfhost.md index c987e55..2f8d428 100644 --- a/content/5.extra/2.selfhost.md +++ b/content/5.extra/2.selfhost.md @@ -25,7 +25,7 @@ networks: - movie-web-network - movie-web: + movie-web-backend: image: ghcr.io/movie-web/backend:latest restart: unless-stopped environment: From 4b1dc698f4a098ef376e515e29ba113c61a1a97b Mon Sep 17 00:00:00 2001 From: Pokey <79169880+Pokeylooted@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:55:36 -0500 Subject: [PATCH 5/5] removed unneeded port exposure.selfhost.md --- content/5.extra/2.selfhost.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/5.extra/2.selfhost.md b/content/5.extra/2.selfhost.md index 2f8d428..8e5722f 100644 --- a/content/5.extra/2.selfhost.md +++ b/content/5.extra/2.selfhost.md @@ -20,8 +20,6 @@ POSTGRES_USER: movie_web_user POSTGRES_DB: movie_web_backend POSTGRES_PASSWORD: YourPasswordHere - ports: - - "5432:5432" networks: - movie-web-network