Skip to content

Instantly share code, notes, and snippets.

View Eucrow's full-sized avatar

Marco A. Ámez Fernández Eucrow

  • Instituto Español de Oceanografía
  • Santander
View GitHub Profile
@Eucrow
Eucrow / pyenv_python_django_gunicorn_circus_nginx.md
Last active August 7, 2022 15:01
pyenv + python + django + gunicorn + circus + nginx in ubuntu 16.04

pyenv + python + django + gunicorn + circus + nginx in ubuntu 16.04

Install dependencies (TODO: check dependencies)

sudo apt-get install -y postgresql-9.5 postgresql-contrib-9.5 postgresql-server-dev-9.5 nginx git circus make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils python-setuptools

Users

Create user for the app

sudo adduser app
@Eucrow
Eucrow / deploy_node_ubuntu_server.md
Last active June 25, 2022 08:45
Deploy node app in ubuntu 16.04 server with MongoDB and PM2
@Eucrow
Eucrow / Steps to start a project with django
Created August 18, 2018 07:15
Steps to start a project with django
Python, pip and virtualenv must be installed.
Then:
mkdir myDirectory
cd myDirectory
virtualenv env
.\env\Scripts\activate
pip install django
python .\env\Scripts\django-admin.py startproject projectName
@Eucrow
Eucrow / deploy_app_from_Git_hub_in_EC3_with_Code_Deploy.md
Last active January 4, 2019 16:10
Steps to deploy application from Git Hub in EC3 with CodeDeploy

Steps to deploy application (or a revision of an application) from Git Hub in EC3 with CodeDeploy

Brief summary created from and adapted to my own experience.

  1. Create instance readdy to work with Code Deploy: https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-ec2-create.html
  2. Create two IAM roles:
  • IAM role for Code Deploy to comunicate with with the EC2 instance: In AWS IAM Console create new role with the "AWSCodeDeployRole" policy.
  • IAm role for EC2 to access S3 (and Git Hub): In AWS IAM Console create new role with the "AmazonS3ReadOnlyAccess" policy.
  1. Attach the role with the "AmazonS3ReadOnlyAccess" policy to the instance.
  2. Create the appspec.yml file in the application (and upload to Git Hub as the rest of the files of the application). This file describes to AWS CodeDeploy how to manage the lifecycle of your application. More info about appspec.yml in https://docs.aws.amazon.com/codedeploy/latest/userguide/application-revisions-appspec-file.html
  3. In AWS Code Deploye, c