@churchsoln/dbms 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
version: '3'
|
|
2
|
+
services:
|
|
3
|
+
churchsoln_backend:
|
|
4
|
+
container_name: churchsoln_backend
|
|
5
|
+
build:
|
|
6
|
+
context: ./churchsoln_backend
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
restart: always
|
|
9
|
+
ports:
|
|
10
|
+
- "5009:5009"
|
|
11
|
+
depends_on:
|
|
12
|
+
- postgres-backend
|
|
13
|
+
env_file: ./churchsoln_backend/.env
|
|
14
|
+
volumes:
|
|
15
|
+
- ./churchsoln_backend/:/app
|
|
16
|
+
- image-volume:/app/uploads/images
|
|
17
|
+
- document-volume:/app/uploads/documents
|
|
18
|
+
- video-volume:/app/uploads/videos
|
|
19
|
+
networks:
|
|
20
|
+
- app-network
|
|
21
|
+
churchsoln_dbms:
|
|
22
|
+
container_name: churchsoln_dbms
|
|
23
|
+
build:
|
|
24
|
+
context: ./churchsoln_dbms
|
|
25
|
+
dockerfile: Dockerfile
|
|
26
|
+
restart: always
|
|
27
|
+
ports:
|
|
28
|
+
- "5007:5007"
|
|
29
|
+
depends_on:
|
|
30
|
+
- postgres
|
|
31
|
+
- redis1
|
|
32
|
+
env_file: ./churchsoln_dbms/.env
|
|
33
|
+
volumes:
|
|
34
|
+
- ./churchsoln_dbms/:/app
|
|
35
|
+
- image-volume:/app/uploads/images
|
|
36
|
+
- document-volume:/app/uploads/documents
|
|
37
|
+
- video-volume:/app/uploads/videos
|
|
38
|
+
networks:
|
|
39
|
+
- app-network
|
|
40
|
+
|
|
41
|
+
postgres:
|
|
42
|
+
image: postgres:15
|
|
43
|
+
container_name: postgres
|
|
44
|
+
env_file: ../.env
|
|
45
|
+
restart: always
|
|
46
|
+
volumes:
|
|
47
|
+
- pgdata:/var/lib/postgresql/data
|
|
48
|
+
networks:
|
|
49
|
+
- app-network
|
|
50
|
+
|
|
51
|
+
pgadmin1:
|
|
52
|
+
image: dpage/pgadmin4
|
|
53
|
+
container_name: pgadmin1
|
|
54
|
+
env_file: ../.env
|
|
55
|
+
ports:
|
|
56
|
+
- "5008:80"
|
|
57
|
+
depends_on:
|
|
58
|
+
- postgres
|
|
59
|
+
networks:
|
|
60
|
+
- app-network
|
|
61
|
+
|
|
62
|
+
redis1:
|
|
63
|
+
image: redis:latest
|
|
64
|
+
container_name: redis1
|
|
65
|
+
ports:
|
|
66
|
+
- "6379:6379"
|
|
67
|
+
volumes:
|
|
68
|
+
- redis-data:/data
|
|
69
|
+
networks:
|
|
70
|
+
- app-network
|
|
71
|
+
|
|
72
|
+
networks:
|
|
73
|
+
app-network:
|
|
74
|
+
driver: bridge
|
|
75
|
+
|
|
76
|
+
volumes:
|
|
77
|
+
pgdata:
|
|
78
|
+
redis-data:
|
|
79
|
+
image-volume:
|
|
80
|
+
document-volume:
|
|
81
|
+
video-volume:
|
package/package.json
CHANGED
package/utils/churchManager.js
CHANGED
|
@@ -58,6 +58,23 @@ class ChurchManager {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
async getChurchIdByDomain(domain) {
|
|
62
|
+
try {
|
|
63
|
+
const churchData = await commonDb.churchDomain.findOne({
|
|
64
|
+
where: { domain },
|
|
65
|
+
attributes: commonDb.churchDomain.selectedFields,
|
|
66
|
+
raw: true,
|
|
67
|
+
});
|
|
68
|
+
if (!churchData) {
|
|
69
|
+
throw new Error(`Church with domain ${domain} not found`);
|
|
70
|
+
}
|
|
71
|
+
return churchData.churchId;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("Error getting church id:", error.message);
|
|
74
|
+
throw new Error(error.message);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
61
78
|
async disconnectInactiveConnections() {
|
|
62
79
|
const now = Date.now();
|
|
63
80
|
const timeout = 30 * 60 * 1000;
|