-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-commands.txt
More file actions
82 lines (58 loc) · 2.3 KB
/
docker-commands.txt
File metadata and controls
82 lines (58 loc) · 2.3 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Development Environment Commands
# ------------------------------
# Start services in development (detached mode)
docker-compose --env-file .env.development up -d
# Stop services in development
docker-compose --env-file .env.development down
# Stop services and remove volumes in development
docker-compose --env-file .env.development down -v
# Production Environment Commands
# -----------------------------
# Start services in production (detached mode)
docker-compose --env-file .env.production up -d
# Stop services in production
docker-compose --env-file .env.production down
# Stop services and remove volumes in production
docker-compose --env-file .env.production down -v
# Useful Additional Commands
# ------------------------
# View all logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f postgres
docker-compose logs -f redis
# Check running services status
docker-compose ps
# PostgreSQL Connection Commands
# ----------------------------
# Connect to PostgreSQL using docker exec (from container)
docker exec -it ais_postgres psql -U ais_dev -d ais_dev_db
# Connect to PostgreSQL using psql (from host machine)
psql -h localhost -p 5432 -U ais_dev -d ais_dev_db
# PostgreSQL Database Commands
# --------------------------
# List all databases (after connecting)
\l
# List all databases (direct command)
docker exec -it ais_postgres psql -U ais_dev -c "\l"
# Switch database (after connecting)
\c ais_dev
# List all tables in current database
\dt
# List all tables with direct command
docker exec -it ais_postgres psql -U ais_dev -d ais_dev_db -c "\dt"
# Note:
# - The -d flag runs containers in detached mode (background)
# - The -f flag follows the log output in real-time
# - The -v flag removes named volumes declared in the volumes section
# - Replace ais_dev and ais_dev_db with your actual username and database name
# - You will be prompted for the password defined in your .env file
# - \l is a psql command to list databases
# - \c is a psql command to switch databases
# - \dt is a psql command to list all tables
# Run following command after any change to see the impact
node .\docker_recreate.js
# Go to postman click send for following route -
localhost:3000/api/storage/initializeDatabase
# then click send for following route -
localhost:3000/api/storage/loadConfigs