{"id":21541530,"url":"https://github.com/trjohnst/lambda-flask-boilerplate","last_synced_at":"2026-04-17T15:33:49.717Z","repository":{"id":149651554,"uuid":"152031860","full_name":"trjohnst/lambda-flask-boilerplate","owner":"trjohnst","description":"Boilerplate repo to deploy flask apps with zappa in a docker container to AWS","archived":false,"fork":false,"pushed_at":"2018-10-10T23:16:04.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T22:55:01.362Z","etag":null,"topics":["boilerplate","docker","flask","python","zappa"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trjohnst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-08T06:52:10.000Z","updated_at":"2018-10-10T23:16:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"a66b955f-30df-41c6-86a1-add954302b58","html_url":"https://github.com/trjohnst/lambda-flask-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trjohnst/lambda-flask-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trjohnst%2Flambda-flask-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trjohnst%2Flambda-flask-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trjohnst%2Flambda-flask-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trjohnst%2Flambda-flask-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trjohnst","download_url":"https://codeload.github.com/trjohnst/lambda-flask-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trjohnst%2Flambda-flask-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31934354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","docker","flask","python","zappa"],"created_at":"2024-11-24T05:05:00.843Z","updated_at":"2026-04-17T15:33:49.701Z","avatar_url":"https://github.com/trjohnst.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis is a boilerplate repo to get started with [Zappa](https://github.com/Miserlou/Zappa). You can use it to build a docker image that can be used to create containers for deploying serverless python apps (built with frameworks like [Flask](http://flask.pocoo.org/), [Django](https://www.djangoproject.com/), etc) to AWS. It was made with [these instructions](https://hackernoon.com/deploy-a-serverless-flask-application-on-aws-lambda-d8ca58af42a4) and includes a few fixes for issues that I experienced with the setup.\n\nThis was run on Docker 18.06.1 on a Mac.\n\nI'm using [python:3.6-alpine](https://github.com/docker-library/python/blob/0c0365d804c2ef4ee8edef652e6a39cdf461e3b2/3.6/alpine3.8/Dockerfile) as a base image to keep things lightweight. The resulting image will be under 500MB.\n\n# Usage\n\n## 1. AWS Configs\n\nAdd a `config` file and `credentials` file to the `aws` folder. You can refer to the [sample config](aws/sample_config) and the [sample credentials](aws/sample_credentials).\n\nYou can generate your own credentials after setting up an AWS account, going into your AWS console and following [these instructions](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).\n\n## 2. Zappa Settings\n\nModify the [zappa_settings.json](zappa_settings.json) file to include your region (matching the one from aws/config) and your profile (matching the one provided in aws/credentials). The current file uses `us-west-1` (California) and `default` as specified in [the sample config](aws/sample_config).\n\n## 3. Build the image\n\nYou can build the image simply with `./build-docker.sh`\n\n## 4. Deploying in a container\n\n```bash\n# Run a container from the image\n./run-docker.sh\n# Activate the pre-made python virtual environment (it has everything you need installed)\nsource serverlessbot/bin/activate\n# Deploy your dev instance\nzappa deploy dev\n```\n\nThe end of the deployment will say `Deployment complete!` followed by a URL. You can navigate to the URL and verify that it says \"Hello World!\"\n\n## 5. Undeploying\n\nOnce you are done running your test, you should undeploy to clean up.\n\nYou can undeploy, while in the virtual environment, with `zappa undeploy` and hit `y` when prompted.\n\nI've also found that the S3 buckets stick around so you may want to delete the bucket that you created. You can find this bucket in your AWS console and it will correspond to the `s3_bucket` setting in [zappa_settings.json](zappa_settings.json).\n\n## 6. Exiting\n\n```bash\n# Get out of the python virtual environment\ndeactivate\n# Exit the container\nexit\n```\n\n# Troubleshooting\n\n## Operation Not Found\n\nIf you encounter output like the following:\n```bash\nTraceback (most recent call last):\n  File \"/usr/local/lib/python3.6/site-packages/zappa/core.py\", line 911, in upload_to_s3\n    self.s3_client.head_bucket(Bucket=bucket_name)\n  File \"/usr/local/lib/python3.6/site-packages/botocore/client.py\", line 320, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n  File \"/usr/local/lib/python3.6/site-packages/botocore/client.py\", line 623, in _make_api_call\n    raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (404) when calling the HeadBucket operation: Not Found\n```\n\nDouble check your credentials! It's likely the `aws/credential` credentials file that you created is not setup right. For instance, having a different region in [zappa_settings.json](zappa_settings.json) from your `aws/config`.\n\n## Anything else\n\nIf an error looks cryptic from the command line or from following the steps above, try using `zappa tail` from the python virtual environment or looking at AWS CloudWatch Logs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrjohnst%2Flambda-flask-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrjohnst%2Flambda-flask-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrjohnst%2Flambda-flask-boilerplate/lists"}