-
Notifications
You must be signed in to change notification settings - Fork 1
/
cat
251 lines (251 loc) · 6.27 KB
/
cat
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
diff --git a/build.prod.sh b/build.prod.sh
index 3c0ce86..a9ac068 100644
--- a/build.prod.sh
+++ b/build.prod.sh
@@ -1,5 +1,5 @@
docker build -f Dockerfile --tag app_image .
-docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build --remove-orphans
+docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build --remove-orphans --force-recreate
docker exec -it app python manage.py migrate
docker image prune -f
echo "Production build complete!"
diff --git a/data/temp/.gitignore b/data/temp/.gitignore
deleted file mode 100644
index 5e7d273..0000000
--- a/data/temp/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
index 00a38df..5da683d 100644
--- a/docker-compose.prod.yml
+++ b/docker-compose.prod.yml
@@ -2,7 +2,7 @@ version: "2"
services:
app:
depends_on:
- - postgres
+# - postgres
- redis
- celerybeat
env_file:
@@ -36,9 +36,9 @@ services:
- network1
links:
- redis
- - postgres
+# - postgres
depends_on:
- - postgres
+# - postgres
- redis
- celerybeat
volumes:
@@ -61,7 +61,7 @@ services:
networks:
- network1
depends_on:
- - postgres
+# - postgres
- redis
- celerybeat
volumes:
@@ -70,7 +70,7 @@ services:
- ./logs:/app/logs
- ./celery/logs:/app/celery/logs
links:
- - postgres
+# - postgres
- redis
env_file:
- .env
@@ -88,10 +88,10 @@ services:
networks:
- network1
depends_on:
- - postgres
+# - postgres
- redis
links:
- - postgres
+# - postgres
- redis
volumes:
- ./:/app
diff --git a/docker-compose.yml b/docker-compose.yml
index a268a1a..5993cda 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,10 +9,10 @@ services:
# image: debian/latest
image: app_image
links:
- - postgres
+ #- postgres
- redis
depends_on:
- - postgres
+ #- postgres
- redis
ports:
- "8000:8000"
@@ -67,76 +67,76 @@ services:
options:
max-size: "10m"
max-file: "3"
- postgres:
- image: postgres:11
- container_name: "postgres"
- restart: on-failure
+# postgres:
+# image: postgres:11
+# container_name: "postgres"
+# restart: on-failure
# https://blog.2ndquadrant.com/basics-of-tuning-checkpoints/
# linux OOM overcommit https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT
- command:
- [
- "-c",
- "autovacuum_vacuum_scale_factor=0.05",
- "-c",
- "vacuum_cost_page_hit=1",
- "-c",
- "vacuum_cost_page_miss=10",
- "-c",
- "vacuum_cost_page_dirty=20",
- "-c",
- "autovacuum_vacuum_cost_delay=20ms",
- "-c",
- "autovacuum_vacuum_cost_limit=1000",
- "-c",
- "enable_seqscan=ON",
- "-c",
- "huge_pages=try",
- "-c",
- "effective_io_concurrency=1",
- "-c",
- "max_parallel_workers_per_gather=4",
- "-c",
- "dynamic_shared_memory_type=posix",
- "-c",
- "max_stack_depth=6MB",
- "-c",
- "maintenance_work_mem=1GB",
- "-c",
- "temp_buffers=64MB",
- "-c",
- "shared_buffers=4GB",
- "-c",
- "default_statistics_target=1000",
- "-c",
- "checkpoint_timeout=120min",
- "-c",
- "checkpoint_completion_target=0.93",
- "-c",
- "max_wal_size=6GB",
- "-c",
- "effective_cache_size=8GB",
- "-c",
- "work_mem=600MB",
- "-c",
- "max_connections=200",
- "-c",
- "random_page_cost=1.05",
- "-c",
- "seq_page_cost=2",
- "-c",
- "log_min_duration_statement=10000",
- "-c",
- "log_temp_files=1",
- ]
- shm_size: "2GB"
- environment:
- POSTGRES_DB: anhd
- POSTGRES_USER: anhd
- POSTGRES_HOST_AUTH_METHOD: trust # fixes error: “Error: Database is uninitialized and superuser password is not specified.”
- networks:
- - network1
- volumes:
- - pg_vol1:/var/lib/postgresql/data
+# command:
+# [
+# "-c",
+# "autovacuum_vacuum_scale_factor=0.05",
+# "-c",
+# "vacuum_cost_page_hit=1",
+# "-c",
+# "vacuum_cost_page_miss=10",
+# "-c",
+# "vacuum_cost_page_dirty=20",
+# "-c",
+# "autovacuum_vacuum_cost_delay=20ms",
+# "-c",
+# "autovacuum_vacuum_cost_limit=1000",
+# "-c",
+# "enable_seqscan=ON",
+# "-c",
+# "huge_pages=try",
+# "-c",
+# "effective_io_concurrency=1",
+# "-c",
+# "max_parallel_workers_per_gather=4",
+# "-c",
+# "dynamic_shared_memory_type=posix",
+# "-c",
+# "max_stack_depth=6MB",
+# "-c",
+# "maintenance_work_mem=1GB",
+# "-c",
+# "temp_buffers=64MB",
+# "-c",
+# "shared_buffers=4GB",
+# "-c",
+# "default_statistics_target=1000",
+# "-c",
+# "checkpoint_timeout=120min",
+# "-c",
+# "checkpoint_completion_target=0.93",
+# "-c",
+# "max_wal_size=6GB",
+# "-c",
+# "effective_cache_size=8GB",
+# "-c",
+# "work_mem=600MB",
+# "-c",
+# "max_connections=200",
+# "-c",
+# "random_page_cost=1.05",
+# "-c",
+# "seq_page_cost=2",
+# "-c",
+# "log_min_duration_statement=10000",
+# "-c",
+# "log_temp_files=1",
+# ]
+# shm_size: "2GB"
+# environment:
+# POSTGRES_DB: anhd
+# POSTGRES_USER: anhd
+# POSTGRES_HOST_AUTH_METHOD: trust # fixes error: “Error: Database is uninitialized and superuser password is not specified.”
+# networks:
+# - network1
+# volumes:
+# - pg_vol1:/var/lib/postgresql/data
logging:
options:
max-size: "10m"
@@ -162,7 +162,7 @@ services:
max-size: "10m"
max-file: "3"
volumes:
- pg_vol1:
+# pg_vol1:
redis_data:
static_volume:
networks:
diff --git a/nginx/init-letsencrypt.sh b/nginx/init-letsencrypt.sh
old mode 100644
new mode 100755