Skip to content

Commit

Permalink
deploy 28 Dec 2022 (#65)
Browse files Browse the repository at this point in the history
* add setup swap and setup https with certbot

* disable ssl

* add swap

* add vm.swappines
  • Loading branch information
galacticor authored Dec 28, 2022
1 parent fd7eb7e commit f49fe6f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .ebextensions/django.config → .ebextensions/02_django.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: "UlasKelas.settings"
POSTGRES_DB: ""
POSTGRES_USER: ""
POSTGRES_PASSWORD: ""
POSTGRES_HOST: ""
SENTRY_DSN: ""
aws:elasticbeanstalk:container:python:
WSGIPath: "UlasKelas.wsgi:application"
aws:elasticbeanstalk:environment:proxy:staticfiles:
/static: static
aws:elasticbeanstalk:environment:process:default:
HealthCheckPath: "/ping"
MatcherHTTPCode: "200-499"
commands:
01_postgres_activate:
command: sudo amazon-linux-extras enable postgresql11
02_postgres_install:
command: sudo yum install -y postgresql-devel
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: "UlasKelas.settings"
POSTGRES_DB: ""
POSTGRES_USER: ""
POSTGRES_PASSWORD: ""
POSTGRES_HOST: ""
SENTRY_DSN: ""
aws:elasticbeanstalk:container:python:
WSGIPath: "UlasKelas.wsgi:application"
aws:elasticbeanstalk:environment:proxy:staticfiles:
/static: static
aws:elasticbeanstalk:environment:process:default:
HealthCheckPath: "/ping"
MatcherHTTPCode: "200-499"

commands:
01_postgres_activate:
command: sudo amazon-linux-extras enable postgresql11
02_postgres_install:
command: sudo yum install -y postgresql-devel
3 changes: 3 additions & 0 deletions .ebextensions/99_setup_swap.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
container_commands:
01setup_swap:
command: "sudo bash .ebextensions/setup_swap.sh"
15 changes: 15 additions & 0 deletions .ebextensions/setup_swap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

SWAPFILE=/var/swapfile
SWAP_MEGABYTES=768

if [ -f $SWAPFILE ]; then
echo "Swapfile $SWAPFILE found, assuming already setup"
exit;
fi

/bin/dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAP_MEGABYTES
/bin/chmod 600 $SWAPFILE
/sbin/mkswap $SWAPFILE
/sbin/swapon $SWAPFILE
sysctl vm.swappiness=15

0 comments on commit f49fe6f

Please sign in to comment.