Skip to content

Instantly share code, notes, and snippets.

@nickdandakis
Created October 14, 2017 18:21
Show Gist options
  • Save nickdandakis/07009260609decbfd16489b8e7c278c1 to your computer and use it in GitHub Desktop.
Save nickdandakis/07009260609decbfd16489b8e7c278c1 to your computer and use it in GitHub Desktop.
Next.js + AWS Elastic Beanstalk + AWS EC2 Container Service + Docker package.json
{
"name": "this-web-scale",
"version": "x.x.x",
"scripts": {
"dev": "node server.js",
"build": "NODE_ENV=production next build",
"start": "NODE_ENV=production node server.js",
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker",
"deploy": "npm run deploy:staging",
"deploy:staging": "eb use token-staging && eb deploy --label v$npm_package_version --verbose",
"deploy:stage": "npm run deploy:staging",
"deploy:production": "eb use token-web && eb deploy --label v$npm_package_version --verbose",
"deploy:prod": "npm run deploy:production",
"build:docker": "docker build -t $npm_package_config_docker_image:$npm_package_version -t $npm_package_config_docker_image:latest .",
"tag:docker": "docker tag $npm_package_config_docker_image $npm_package_config_docker_repo/$npm_package_config_docker_image:$npm_package_version",
"tag-latest:docker": "docker tag $npm_package_config_docker_image $npm_package_config_docker_repo/$npm_package_config_docker_image:latest",
"push:docker": "docker push $npm_package_config_docker_repo/$npm_package_config_docker_image:$npm_package_version",
"push-latest:docker": "docker push $npm_package_config_docker_repo/$npm_package_config_docker_image:latest",
"login:docker": "eval $(aws ecr get-login --no-include-email --region us-east-1)",
},
"config": {
"docker": {
"repo": "$AWS_ORG_ID.dkr.ecr.us-east-1.amazonaws.com",
"image": "$ECS_REPOSITORY"
}
},
"dependencies": {
...
},
"devDependencies": {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment