Merge pull request 'Setup PokeTube for Docker Compose' (#48) from Korbs/poketube:main into main

Reviewed-on: https://codeberg.org/Ashley/poketube/pulls/48
This commit is contained in:
Ashley 2023-11-23 03:57:08 +00:00
commit 16f8c430a0
6 changed files with 37 additions and 20 deletions

View file

@ -5,4 +5,6 @@
node_modules node_modules
invidious-source invidious-source
json.sqlite json.sqlite
*.md *.md
docker-compose.yml
Dockerfile

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
node_modules/ node_modules/
yarn.lock yarn.lock
package-lock.json package-lock.json
.env .env
json.sqlite

View file

@ -66,7 +66,7 @@ you can view the source code of the openh264 codec in this repo :3 --> https://g
PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY BE COVERED BY PATENTS OR HAVE LEGAL ISSUES. PATENT AND COPYRIGHT LAWS OPERATE DIFFERENTLY DEPENDING ON WHICH COUNTRY YOU ARE IN. PLEASE OBTAIN LEGAL ADVICE IF YOU ARE UNSURE WHETHER A PARTICULAR PATENT OR RESTRICTION APPLIES TO A CODEC YOU WISH TO USE IN YOUR COUNTRY. PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY BE COVERED BY PATENTS OR HAVE LEGAL ISSUES. PATENT AND COPYRIGHT LAWS OPERATE DIFFERENTLY DEPENDING ON WHICH COUNTRY YOU ARE IN. PLEASE OBTAIN LEGAL ADVICE IF YOU ARE UNSURE WHETHER A PARTICULAR PATENT OR RESTRICTION APPLIES TO A CODEC YOU WISH TO USE IN YOUR COUNTRY.
## Hosting Poketube~ ## Hosting Poketube~
### With NodeJS
- To self host your own Poketube instance, you'll need the following: - To self host your own Poketube instance, you'll need the following:
- [Node.js](https://nodejs.org/en/download/) - [Node.js](https://nodejs.org/en/download/)
@ -98,6 +98,26 @@ node server.js
Congrats, Poketube should now be running on `localhost:6003`! Congrats, Poketube should now be running on `localhost:6003`!
### With Docker
Create a new directory for PokeTube:
```
mkdir poketube && cd poketube
```
Download the docker compose and config file:
```
curl -O https://codeberg.org/Ashley/poketube/raw/branch/main/docker-compose.yml
```
Run PokeTube:
```
docker compose up -d
```
PokeTube should be running on `http://localhost:6003`.
The port can be changed with the config file you downloaded, just change the `server_port` option.
## PokeTube community! ## PokeTube community!
Join the community on [revolt](https://rvlt.gg/poketube) :3 Join the community on [revolt](https://rvlt.gg/poketube) :3

View file

@ -5,5 +5,6 @@
"invchannel": "https://invid-api.poketube.fun/api/v1", "invchannel": "https://invid-api.poketube.fun/api/v1",
"cacher_max_age": "1800", "cacher_max_age": "1800",
"enablealwayshttps": false, "enablealwayshttps": false,
"t_url": "https://t.poketube.fun/" "t_url": "https://t.poketube.fun/",
"server_port": "6003"
} }

View file

@ -1,17 +1,9 @@
version: "3"
services: services:
proxy: poketube:
build: image: quay.io/sudovanilla/poketube
context: .
dockerfile: p/Dockerfile
target: release-aio
# cache_to:
# cache_from:
restart: unless-stopped restart: unless-stopped
volumes:
- ./config.json:/poketube/config.json
ports: ports:
- 80:80 - "6003:6003"
- 443:443
# - 3000:3000
environment:
- HOSTNAME=example.com
- EMAIL=user@email.com # required for https
- STAGING=true # Set to "true" to use staging

View file

@ -16,6 +16,7 @@ const fetcher = require("../libpoketube/libpoketube-dislikes.js");
const core = require("../libpoketube/libpoketube-core.js"); const core = require("../libpoketube/libpoketube-core.js");
const musicInfo = require("music-info"); const musicInfo = require("music-info");
const wiki = require("wikipedia"); const wiki = require("wikipedia");
const config = require("../../config.json")
const fetch = require("node-fetch"); const fetch = require("node-fetch");
const toJson = require("xml2json").toJson; const toJson = require("xml2json").toJson;
@ -40,10 +41,10 @@ function initlog(args) {
* Initializes the application and starts listening on the specified port or something idk aaaaa help me * Initializes the application and starts listening on the specified port or something idk aaaaa help me
* *
* @param {object} app - The express application * @param {object} app - The express application
* @param {string} [port="3000"] - The port to listen on * @param {string} [port=config.server_port] - The port to listen on
*/ */
function init(app, port) { function init(app, port) {
if (!port) port = "6003"; if (!port) port = config.server_port;
try { try {
app.listen(port, () => { app.listen(port, () => {
initlog("Loading Poketube: success!" + " on port " + port); initlog("Loading Poketube: success!" + " on port " + port);