viewtube icon indicating copy to clipboard operation
viewtube copied to clipboard

Viewtube Docker container not working.

Open Seven0492 opened this issue 3 years ago • 10 comments

I feel ashamed of myself asking this, but I've done everything I knew to do this.

So a while ago I had found Piped, but found it slow, so I wanted to self-host, then I found a supposedly friendlier self-hosting alternative! Viewtube!

So I started with the method in README.md with docker-compose, but when I tried starting it with yarn serve:api and yarn serve:client. It gave me a bunch of errors I couldn't hope to understand the source of, so I tried with using docker directly.

So I setup Docker and everything, the necessary images (Except mongodb, I just installed the mongo image since the mongodb image seemingly doesn't exist or isn't docker pull-able even with docker login). And after I figured out how to declare environment variables in containers I was able to start it up.

And then I waited a bit, and opened http://localhost:8066/ like I asked it to be in the environment variable.

And then I tried again a bit later, didn't show anything.

I stopped and restarted the container multiple times with more env variables, didn't work.

After one or two minutes of it taking resources and gets out of 'starting' mode, it is declared 'unhealthy' by Docker.

And when I specified a docker volume, it didn't even use that and just made a new one!

So I think my problem here is that the Viewtube container doesn't read the env variables. It only quits when there is no VIEWTUBE_URL env variable.

Relevant info

OS: Fedora Linux 36 (Workstation Edition) x86_64 Latest Docker version. Latest version of images required for Viewtube.

Seven0492 avatar Aug 23 '22 08:08 Seven0492

Hi! I'll gladly help you with the setup. I am a bit busy right now, please give me a couple of days and I'll get back to you

moisout avatar Aug 26 '22 10:08 moisout

No problem! I've since switched to Arch linux and I'm loving it so far! I'm gonna try to install it again to see if it works!

Seven0492 avatar Sep 01 '22 21:09 Seven0492

I'm having problems with a runtime/startup ENOTFOUND error with 'viewtube-redis' whether or not the 'viewtube-redis' and 'viewtube-mongodb' is up, so I think I still need help :P

Seven0492 avatar Sep 03 '22 22:09 Seven0492

I'm gonna try Piped a bit to see if it works.

Seven0492 avatar Sep 16 '22 23:09 Seven0492

Nope, piped doesn't work either... strange. Is it my machine after all?

Seven0492 avatar Sep 20 '22 23:09 Seven0492

Okay, so it worked for a moment, GUI and everything, but only after renaming everything in my docker-compose file. But when I added a host name for it in /etc/hosts, that host name doesn't work, why?

Seven0492 avatar Sep 21 '22 00:09 Seven0492

Apart from that, it works perfectly now! I will share here my docker-compose.yml file for anyone who wants to use it!

version: "3"

services:
  viewtube2:
    container_name: viewtube2
    restart: unless-stopped
    image: mauriceo/viewtube:latest
    depends_on:
      - viewtube2-mongodb
      - viewtube2-redis
    networks:
      - viewtube
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./data:/data
    environment:
      - VIEWTUBE_URL=http://localhost:8066/
      - VIEWTUBE_DATABASE_HOST=viewtube2-mongodb
      - VIEWTUBE_REDIS_HOST=viewtube2-redis
      - VIEWTUBE_DATA_DIRECTORY=/data
    ports:
      - 8066:8066

  viewtube2-mongodb:
    container_name: viewtube2-mongodb
    image: mongo:latest
    networks:
      - viewtube
    restart: unless-stopped
    volumes:
      - ./data/db:/data/db

  viewtube2-redis:
    container_name: viewtube2-redis
    image: redis:latest
    networks:
      - viewtube
    restart: unless-stopped
    volumes:
      - ./data/redis:/data

networks:
  viewtube:

PS: To use it, you have to use the docker-compose up command to start it, docker-compose down to stop it, all in the same directory has the one with docker-compose.yml.

Access it in https://localhost:8066!

Seven0492 avatar Sep 21 '22 00:09 Seven0492

Modifying configurations was the worst thing I could do. I wondered why another laptop accessing the server didn't work, so I played and tweaked the VIEWTUBE_URL variable to see if it changed anything and could work. It doesn't, it even broke about everything. I've changed the name of everything this time in the config (Changed back VIEWTUBE_URL to what it was before) and it hasn't fixed it, here's the network error:

{
  "requestConfig": {
    "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
    },
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 30000,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "headers": {
      "Accept": "application/json, text/plain, */*"
    },
    "baseURL": "https://localhost:8066/api/",
    "withCredentials": true,
    "method": "get",
    "url": "videos/6K-tTaxLqJQ"
  },
  "responseData": null,
  "message": "Network Error"
}

Seven0492 avatar Sep 22 '22 01:09 Seven0492

Nevermind, sorry for the false alert! When I changed back the VIEWTUBE_URL variable, I wrote it on https protocol.

Seven0492 avatar Sep 22 '22 01:09 Seven0492

I'll just make this a place where I'll dump all my mistakes so people know what to do when they have them :P My own way of contributing.

Seven0492 avatar Sep 22 '22 01:09 Seven0492

There are now more extensive docs, where everything should be covered: https://viewtube.wiki. If anything is missing, please let me know by opening a new issue

moisout avatar Mar 15 '23 23:03 moisout