Skip to content

Instantly share code, notes, and snippets.

View johndavedecano's full-sized avatar
🏠
Working 🇳🇱

John Dave Decano johndavedecano

🏠
Working 🇳🇱
View GitHub Profile
@johndavedecano
johndavedecano / awc-ecs-access-to-aws-efs.md
Created July 8, 2019 15:30 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@johndavedecano
johndavedecano / EventSystem.js
Created April 17, 2016 14:38 — forked from minwe/EventSystem.js
Global event system for React.js
var EventSystem = (function() {
var self = this;
self.queue = {};
return {
publish: function (event, data) {
var queue = self.queue[event];
if (typeof queue === 'undefined') {
@johndavedecano
johndavedecano / app.js
Created March 17, 2016 12:42 — forked from lykmapipo/app.js
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@johndavedecano
johndavedecano / cors
Created February 27, 2016 14:32 — forked from michaldarda/cors
Just include in your nginx.conf inside location block to enable CORS, I assume that you have more_set_headers plugin compiled
# nginx does not allow add_headers inside if unless its location
set $cors "true";
# Nginx doesn't support nested If statements. This is where things get slightly nasty.
# Determine the HTTP request method used
if ($request_method = 'OPTIONS') {
set $cors "${cors}options";
}
if ($request_method = 'GET') {