https://github.com/lucasfrancaid/docker-python-serverless-offline
A docker image to run python lambda functions with serverless offline.
https://github.com/lucasfrancaid/docker-python-serverless-offline
docker docker-image python3 serverless serverless-framework serverless-offline serverless-offline-plugin
Last synced: about 1 year ago
JSON representation
A docker image to run python lambda functions with serverless offline.
- Host: GitHub
- URL: https://github.com/lucasfrancaid/docker-python-serverless-offline
- Owner: lucasfrancaid
- Created: 2021-06-05T09:50:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T20:03:25.000Z (over 4 years ago)
- Last Synced: 2025-02-08T12:46:01.025Z (about 1 year ago)
- Topics: docker, docker-image, python3, serverless, serverless-framework, serverless-offline, serverless-offline-plugin
- Language: Shell
- Homepage: https://hub.docker.com/r/lucasfrancaid/python-serverless-offline
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/lucasfrancaid/docker-python-serverless-offline/actions/workflows/docker-image.yml)
# Docker Python Serverless Offline
An image to run your python offline
## Disclaimers
If you need a connection with a postgres database, use lucasfrancaid/python-serverless-offline:slim-buster.
The serverless.yml is required to setup your offline app.
## Usage with Docker Compose
Create a docker-compose.yml in your directory and paste:
```yml
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:
```bash
docker-compose up
```
## Environment variables
If you need access aws resources, you can add environment variables. Follow example: [docker-compose.yml](./docker-compose.yml)
Available variables:
```yml
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: # [OPTIONAL] Used to access resources of serverless framework
AWS_ACCESS_KEY_ID: # [OPTIONAL] Is required if you need use aws resources, e.g.: DynamoDB
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