Skip to content

Commit

Permalink
Merge pull request #19 from openstates/add-dockerfile-example
Browse files Browse the repository at this point in the history
  • Loading branch information
elseagle authored Jun 7, 2024
2 parents 4375f0e + de9bd30 commit ff27999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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
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

0 comments on commit ff27999

Please sign in to comment.