pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
at main 95 lines 3.3 kB view raw
1# Guide to Self-Deployment with Docker Compose 2 3<Steps> 4 <Steps.Step> 5 **Install Docker and Docker Compose:** 6 7 Ensure that Docker and Docker Compose are installed on your system. You can follow the official Docker documentation for installation instructions: 8 - [Install Docker](https://docs.docker.com/get-docker/) 9 </Steps.Step> 10 11 <Steps.Step> 12 **Create a Docker Compose file:** 13 14 Create a new file named `docker-compose.yml` in your project directory and paste the following content into it: 15 16 ```yaml 17 services: 18 postgres: 19 image: postgres 20 environment: 21 POSTGRES_USER: pstream_user 22 POSTGRES_DB: pstream 23 POSTGRES_PASSWORD: YourPasswordHere 24 ports: 25 - "5432:5432" 26 networks: 27 - p-stream-network 28 p-stream: 29 image: ghcr.io/dumbutdumber/backend:latest 30 environment: 31 DATABASE_URL: postgresql://pstream_user:YourPasswordHere@postgres:5432/pstream 32 CRYPTO_SECRET: 32CharacterLongStringHere 33 META_NAME: unofficial-backend 34 ports: 35 - "80:80" 36 depends_on: 37 - postgres 38 networks: 39 - p-stream-network 40 41 p-stream-frontend: 42 build: 43 context: https://github.com/p-stream/p-stream.git 44 args: 45 TMDB_READ_API_KEY: "YourTMDBReadAPIKeyHere" 46 CORS_PROXY_URL: "https://cors.example.tld https://second.cors.example.tld" 47 BACKEND_URL: "https://backend.example.tld" 48 DMCA_EMAIL: "YourEmail" 49 PWA_ENABLED: "true" 50 APP_DOMAIN: "YourDomainHere" 51 OPENSEARCH_ENABLED: "true" 52 GA_ID: "Google ID Here" 53 ports: 54 - "80:80" 55 networks: 56 - p-stream-network 57 restart: unless-stopped 58 59 p-stream-proxy: 60 image: ghcr.io/p-stream/simple-proxy:latest 61 ports: 62 - "3000:3000" 63 networks: 64 - p-stream-network 65 restart: unless-stopped 66 67 networks: 68 p-stream-network: 69 driver: bridge 70 ``` 71 **Important:** 72 * Replace `YourPasswordHere` with your secure database password. 73 * Generate a strong session secret and replace `32CharacterLongStringHere`. 74 * Replace `TMDBReadAPIKey` with your api key learn more [here](../client/tmdb.mdx). 75 * replace `yourDomainHere` with whatever you'll be using to access your main site, like pstream.mov 76 * replace `meta__name` and `meta__description` 77 78 </Steps.Step> 79 80 <Steps.Step> 81 **Start the Backend:** Open a terminal in the directory containing `docker-compose.yml` and execute: 82 83 ```bash 84 docker compose up --detach 85 ``` 86 87 </Steps.Step> 88</Steps> 89### Accessing Your Backend 90 91Your services should be accessible on `(YourPrivateIP):port`. To share it outside your local network, you'll need to configure port forwarding or cloudflared tunnel. 92 93### Optional: Implementing a Reverse Proxy 94 95To 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/).