./commands.py - A simple utility for executing commands on a server or inside a docker container. Just run:
./commands.py --help
docker compose up or docker compose up -d
docker compose stop
docker compose build
docker compose logs or docker compose logs backend
docker compose logs --tail 10
docker exec -it 1gency-app-backend bash
Then execute inside the container:
./commands.py createuser --username=YourUsername --password=YourPassword --is-super
docker exec -it 1gency-app-db psql -U python upwork_tools -p 5434
docker exec -it 1gency-app-db pg_dump -U python upwork_tools -p 5434 > dump-`date +%Y-%m-%d_%H:%m:%S`.bak
cd scripts
./recreate_db.sh dump_file_name
where dump_file_name can be a file or a symbolic link to file which from you want imported to. During the run of the recreate_db.sh script, the old (existing) database will be backed up into a file named ./existing-YYYY-mm-dd_hh_MM_ss.bak
For further info, click either backend or client. Thanks.
# Build and start the containers:
sudo docker compose up -d --build
# Then create a user:
sudo docker compose exec backend ./commands.py createuser --username admin --password admin --is-super
# Obtain your auth token:
token=$(curl --request POST \
--header 'Content-Type: application/json' \
--data-raw '{"username": "admin", "password": "admin"}' \
http://localhost:5000/api/login/ | python3 -c 'import sys, json; print(json.load(sys.stdin)["token"])')