Sign inSign up

lucasfrancaid/python-serverless-offline

By lucasfrancaid

•Updated almost 5 years ago

An image to run python lambda functions in your machine with serverless-offline.

Image
0

457

lucasfrancaid/python-serverless-offline repository overview

Docker Image CI

⁠Docker Python Serverless Offline

An image to run python lambda functions in your machine with serverless-offline.

⁠Disclaim

If you need a connection with a postgres database, use lucasfrancaid/python-serverless-offline:slim-buster

⁠Usage with Docker Compose

Create a docker-compose.yml in your directory and paste:

version: '3.8'

services:
  serverless:
    container_name: python_serverless
    image: lucasfrancaid/python-serverless-offline:alpine  # or slim-buster 
    ports:
      - '3000:3000'
    volumes:
      - .:/usr/app

A requirements.txt file is required to install dependencies. If you not have dependencies, just ignore. But, if you have, add a requriments.txt in the same path of docker-compose.yml

Run serverless-offline:

docker-compose up

⁠Environment variables

If you need access aws resources, you can add environment variables. Follow example: docker-compose.yml⁠
Available variables:

HTTP_PORT: 3001  # [OPTIONAL] Default is 3000. If you change http port, you should change your port routing in docker-compose.yml
SERVERLESS_ACCESS_KEY: <SERVERLESS_ACCESS_KEY>  # [OPTIONAL] Used to access resources of serverless framework
AWS_ACCESS_KEY_ID: <AWS_ACCESS_KEY_ID>  # [OPTIONAL] Is required if you need use aws resources, e.g.: DynamoDB
AWS_SECRET_ACCESS_KEY: <AWS_SECRET_ACCESS_KEY>  # [OPTIONAL] Is required if you need use aws resources, e.g.: DynamoDB

⁠Contribute

Help me to write a better image to python-serverless-offline https://github.com/lucasfrancaid/docker-python-serverless-offline⁠

Tag summary

Content type

Image

Digest

Size

269.7 MB

Last updated

almost 5 years ago

docker pull lucasfrancaid/python-serverless-offline