A simple web app for family to download videos from the web (think vlogs for offline viewing).
If you just need to start postgres container:
docker compose -f postgres/compose.yml up --detach
If you need to rebuild the dev database (postgres container will be started automatically):
cd src
./init_db_dev.sh
Use docker for Postgresql.
Verify if docker is already installed
sudo docker run hello-world
You should get a message that indicates Docker is installed correctly. If not, follow instructions to install Docker.
The postgres container has an application specific database called "videodl". This database is in addition to the standard "postgres" default database. To connect to the "videodl" database execute the following:
docker exec -it videodl-db psql -U postgres -d videodl
NOTE: The dev database should be initialized and running first.
cd src
python3 app.py
NOTE: The dev database should be initialized and running first.
cd src
python3 worker_run.py
NOTE: The Github Actions workflow will package the application files, support files, and configuration files into a single tar file. The tar file will then be copied to an ftp server.
Copy the tar file from the ftp server to the deploy server.
Stop the services that run the application. This is needed so the application files can be safely replaced.
sudo systemctl stop videodl_worker.service
sudo systemctl stop videodl.service
cd
into the directory that contains all the application files.
Delete all the files in the directory
rm -rf *
Copy the tar file that was copied from the FTP server to the current directory.
Unpack the tar file
tar xvfz <tar_file>
If the systemd
service files have been updated:
Copy the service files to /usr/local/lib/systemd/system/
.
Reload the systemd
daemon to pickup the new changes.
sudo systemctl daemon-reload
Create a new python virtual environment.
python3 -m venv venv
Activate the python virtual environment.
source venv/bin/activate
Install package dependencies
pip install -r requirements.txt
If the application database needs to be upgraded.
cd
into the src/
directory.
Upgrade the database.
flask db upgrade
Start the applications that run the application.
sudo systemctl start videodl_worker.service
sudo systemctl start videodl.service