Merge pull request #7 from Spengreb/ez-local-dev

Add docker compose setup
This commit is contained in:
Spengreb 2026-05-04 16:37:24 +02:00 committed by GitHub
commit 8fb51e6dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 57 additions and 2 deletions

2
.gitignore vendored
View file

@ -19,3 +19,5 @@ www/js/cytube-google-drive.meta.js
www/js/player.js www/js/player.js
tor-exit-list.json tor-exit-list.json
*.patch *.patch
mysql/
peertube-hosts.json

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM node:20
RUN apt update && apt install -y build-essential git wget
COPY ./ /app
WORKDIR /app
RUN rm -rf node_modules lib package-lock.json
RUN npm cache clean --force
RUN npm install
RUN /bin/sh /app/postinstall.sh
RUN npm run build-server
RUN npm rebuild
RUN wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp
RUN chmod a+rx /usr/local/bin/yt-dlp
CMD ["node", "index.js"]

View file

@ -4,11 +4,11 @@
# user: username to authenticate as # user: username to authenticate as
# password: password for user # password: password for user
mysql: mysql:
server: 'localhost' server: 'mysql'
port: 3306 port: 3306
database: 'cytube3' database: 'cytube3'
user: 'cytube3' user: 'cytube3'
password: '' password: 'strong-password-here'
pool-size: 10 pool-size: 10
# Define IPs/ports to listen on # Define IPs/ports to listen on

35
docker-compose.yml Normal file
View file

@ -0,0 +1,35 @@
version: "3.7"
services:
sync:
build: .
depends_on:
mysql:
condition: service_healthy
ports:
- "8080:8080"
- "1337:1337"
- "8443:8443"
volumes:
- "./templates/head.pug:/app/templates/head.pug"
- "./favicon.ico:/app/www/favicon.ico"
- "./config.yaml:/app/config.yaml"
mysql:
image: docker.io/library/mariadb:latest
healthcheck:
test: ["CMD", "mariadb-admin","ping","-h","localhost", "-u", "root", "--password=sync"]
interval: 5s
timeout: 3s
retries: 100
environment:
- MARIADB_AUTO_UPGRADE=1
- MARIADB_ROOT_PASSWORD=sync
- MARIADB_DATABASE=cytube3
- MARIADB_USER=cytube3
- MARIADB_PASSWORD=strong-password-here
volumes:
# This will create and mount the mysql files in the same folder as the docker-compose.yml file.
# You can change this to be anywhere.
# This will provide data persistence to your MariaDB database.
- "./mysql:/var/lib/mysql"
# If you are using a reverse proxy please do not forget to add the network here as well.
# Refer to the Readme for more information regarding using a Reverse Proxy.