Skip to content

Commit c59901c

Browse files
authored
Merge pull request #178 from Riyad-Murad/admin_pages_dev
admin_pages_dev: Modified docker-compose configurattion
2 parents f1d3a26 + a2cf023 commit c59901c

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.github/workflows/stacksDockerDeployProduction.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ jobs:
103103
source: "amp-client/dist"
104104
target: "/home/${{ secrets.EC2_USER }}/"
105105

106+
- name: Copy Database Low Memory cofiguration file to EC2
107+
uses: appleboy/scp-action@v1
108+
with:
109+
host: ${{ secrets.EC2_HOST_PRODUCTION }}
110+
username: ${{ secrets.EC2_USER }}
111+
key: ${{ secrets.EC2_KEY }}
112+
source: "mysql-lowmem.cnf"
113+
target: "/home/${{ secrets.EC2_USER }}/"
114+
106115
- name: Deploy on S3 bucket
107116
uses: appleboy/ssh-action@v1
108117
with:

.github/workflows/stacksDockerDeployStaging.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ jobs:
141141
source: "docker-compose.yaml"
142142
target: "/home/${{ secrets.EC2_USER }}/"
143143

144+
- name: Copy Database Low Memory cofiguration file to EC2
145+
uses: appleboy/scp-action@v1
146+
with:
147+
host: ${{ secrets.EC2_HOST_STAGING }}
148+
username: ${{ secrets.EC2_USER }}
149+
key: ${{ secrets.EC2_KEY }}
150+
source: "mysql-lowmem.cnf"
151+
target: "/home/${{ secrets.EC2_USER }}/"
152+
144153
Deploy-To-EC2:
145154
needs:
146155
[

amp-laravel/dockerShell.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ else
2323
fi
2424

2525
php artisan config:clear
26+
php artisan cache:clear
27+
php artisan route:clear
28+
php artisan view:clear
2629
php artisan config:cache
30+
php artisan route:cache
31+
php artisan view:cache
32+
2733
php artisan migrate --seed --force
2834
apache2-foreground

docker-compose.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,34 @@ services:
1313
- mysql-database
1414
restart: always
1515
command: ./dockerShell.sh
16+
mem_limit: 300m
17+
cpus: 0.35
1618

1719
mysql-database:
1820
image: mysql:8.0
1921
restart: always
22+
ports:
23+
- 3306:3306
2024
environment:
2125
MYSQL_ROOT_PASSWORD: placeholder
2226
MYSQL_DATABASE: placeholder
2327
volumes:
2428
- mysql-data:/var/lib/mysql
25-
ports:
26-
- 3306:3306
29+
- ./mysql-lowmem.cnf:/etc/mysql/conf.d/custom.cnf
30+
mem_limit: 400m
31+
cpus: 0.40
32+
33+
2734

2835
node-server:
2936
image: riyadmurad44/node_amp_intelligence:latest
3037
ports:
3138
- 3001:3001
3239
restart: always
40+
environment:
41+
- NODE_OPTIONS=--max-old-space-size=128
42+
mem_limit: 150m
43+
cpus: 0.25
3344

3445
volumes:
3546
mysql-data:

mysql-lowmem.cnf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[mysqld]
2+
key_buffer_size = 8M
3+
innodb_buffer_pool_size = 64M
4+
query_cache_size = 4M
5+
max_connections = 30
6+
thread_cache_size = 4
7+
table_open_cache = 32

0 commit comments

Comments
 (0)