Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile example #19

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,4 @@ cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python

Dockerfile
elseagle marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 3 additions & 1 deletion Dockerfile → Dockerfile-example
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM python:3.9-alpine
RUN apk add --update --no-cache build-base libffi-dev
RUN apk add --update --no-cache build-base libffi-dev rust cargo

ENV AWS_ACCESS_KEY_ID=XXXXX
ENV AWS_SECRET_ACCESS_KEY=XXXXX
ENV AWS_DEFAULT_REGION=us-east-1
ENV BUILD_LIB=false


RUN pip install poetry

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ AWS_DEFAULT_PROFILE=openstates poetry run zappa update [stage]

Where [stage] is the stage to deploy to. This can be either dev or prod.

## Deploy via Docker
- Make a copy of Dockerfile-example to create Dockerfile
- Update `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` with your creds
- Run `docker build --progress=plain .`

## S3 Bucket Lifecyle

The S3 bucket that the lambda function is uses should have a lifecycle policy that deletes the files after 2
Expand Down
Loading