Skip to content

Instantly share code, notes, and snippets.

View ops-gaurav's full-sized avatar
:octocat:
may the forks be with you

Gaurav Sharma ops-gaurav

:octocat:
may the forks be with you
View GitHub Profile
@ops-gaurav
ops-gaurav / Default
Created October 3, 2017 11:37
nginx configuration
server {
listen 80;
listen [::]:80;
server_name localhost;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
@ops-gaurav
ops-gaurav / Default
Created October 3, 2017 11:40
nginx upstream proxy
upstream nodejs {
server localhost:9102;
}
# HTTP — redirect all traffic to HTTPS
server {
underscores_in_headers on;
listen 80;
listen [::]:80 default_server ipv6only=on;
server_name senditlocal.io;
root /var/www/si/sendit_web/dist/;
@ops-gaurav
ops-gaurav / config-docker-ubuntu.sh
Last active December 13, 2017 07:35
Shell script for configuring docker on newly installed ubuntu VM machine
#!/bin/bash
sudo bash
apt-get update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-cache policy docker-ce
apt-get install -y docker-ce
docker —version
"use strict";
import * as nconf from 'nconf';
nconf.argv().env().file({ file: 'config.json' });
import databaseSetup from "../../infrastructure/DatabaseSetup";
import application from "../../application/application";
import { GetIdeasRequest, GetIdeasResponse } from "../../scenarios/GetIdeas";
import { InsertIdeaRequest, InsertIdeaResponse } from "../../scenarios/InsertIdea";
@ops-gaurav
ops-gaurav / config.yml
Created January 30, 2018 13:06
circleCI Continuous deployment with docker. NodeJS
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
branches:
only:
- master
@ops-gaurav
ops-gaurav / Dockerrun.aws.json
Created January 30, 2018 13:09
AWS ElasticBeanstalk sample docker configuration file (self made. Subjected to bugs/errors)
{
"AWSEBDockerrunVersion": 2,
"volumes": [{
"name": "mongo-data",
"host": {
"sourcePath": "./data/db"
}
}, {
"name": "nginx-proxy-config",
"host": {
@ops-gaurav
ops-gaurav / docker-compose.yml
Created January 30, 2018 13:13
DockerCompose Nodejs, Express, MongoDB, Nginx, Staging/Production
# This is the production variant of
# docker deployment
version: '3'
services:
#built by master branch
<container-name>:
image: index.docker.io/<account>/<repo>:master
container_name: '<app-name>'
ports:
- 8000:3000
@ops-gaurav
ops-gaurav / docker-compose.yaml
Last active March 26, 2018 12:06
Docker compose single docker nodejs application on different ports using nginx server. Complete docker stack
# This is the production variant of
# docker deployment for litnite
version: '3'
services:
#built by master branch
litnite-app:
image: index.docker.io/litnite/backend:master
container_name: 'litnite'
ports:
- 3001:3001
@ops-gaurav
ops-gaurav / setup-jenkins-ubuntu.sh
Last active March 22, 2018 18:21
Configuring jenkins script
#!/bin/bash
echo "Downloading jenkins...."
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins -y
echo "Starting jenkins..."
sudo systemctl start jenkins
Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:PutObject",
"s3:GetObject"