-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmds.cmd
More file actions
50 lines (34 loc) · 1.56 KB
/
cmds.cmd
File metadata and controls
50 lines (34 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# capture all library in requirement txt file
pip freeze | cut -d'=' -f1 > requirements_transform.txt
pipdeptree --freeze --warn silence | grep -E '^[a-zA-Z0-9\-_]+' | cut -d'=' -f1 > requirements.txt
# capture library with version number
pipdeptree --freeze --warn silence | grep -E '^[a-zA-Z0-9\-_]+' > requirements.txt
# for windows
pipdeptree --freeze --warn silence | findstr /R "^[a-zA-Z0-9\-_]" > requirements.txt
#execute docker mongodb in container
docker run -d --name mongodb-container -p 27017:27017 mongo
#execute docker mongodb in container with volume
docker compose down all && docker compose -f docker-compose.yml up -d --build
#execute FastAPI server
uvicorn app.main:app --reload
#Kill port in linux if occupied by VSCode
sudo lsof -i :8000
kill -9 <PID>
# to stop mongodb
net stop MongoDB
#docker compose validation
docker-compose config
#If the output doesn't show any errors, your file is valid. Then you can start the services:
docker-compose up --build
#If you want to run the services in the background, you can use the -d flag:
docker compose up -d --build
# -f is used for custom filename for docker compose
docker compose -f docker-compose.yml up -d --build
docker run -it chatbot_backend-fastapi_application /bin/bash
# This is test
# Run the command to fetch the latest references from GitHub
git fetch --prune
# Identify local branches not tracked on GitHub
git branch -vv | grep ': gone' | awk '{print $1}'
# Run the following command to delete all untracked local branches
git branch -vv | grep ': gone' | awk '{print $1}' | xargs -r git branch -d