Last active
November 30, 2022 15:50
-
-
Save sheep-snow/39a5cf24be6c0f3500c3cc61321f9151 to your computer and use it in GitHub Desktop.
awslambda-python-docker-baseimage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def handler(event, context): | |
| '''descipt here''' | |
| return {"statusCode": 200, "body": "OK"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM amazon/aws-lambda-python:3.9 | |
| COPY . ${LAMBDA_TASK_ROOT} | |
| ENV PYTHONUTF8=1 | |
| ENV APP_NAME=${APP_NAME:-SOME_APP_NAME} | |
| # Install AWS Cli | |
| RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | |
| && unzip awscliv2.zip \ | |
| && ./aws/install \ | |
| && aws --version | |
| # Install Poetry | |
| RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \ | |
| cd /usr/local/bin && \ | |
| ln -s /opt/poetry/bin/poetry && \ | |
| poetry config virtualenvs.create false | |
| # Install python environment | |
| RUN poetry install --no-root --no-dev | |
| CMD [ "app.handler" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [virtualenvs] | |
| in-project = true | |
| path = ".venv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [tool.poetry] | |
| name = "SOME_APP_NAME" | |
| version = "0.1.0" | |
| description = "" | |
| authors = [""] | |
| license = "MIT" | |
| [tool.poetry.dependencies] | |
| python = "^3.9" | |
| boto3 = "^1.18" | |
| [tool.poetry.dev-dependencies] | |
| [build-system] | |
| requires = ["poetry-core>=1.0.0"] | |
| build-backend = "poetry.core.masonry.api" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment