Я использую следующий шаблон.yaml:
< pre class="lang-yaml Prettyprint-override">
Код: Выделить всё
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
TechMate Internal API
Globals:
Function:
Timeout: 60
Parameters:
Table:
Type: String
Default: Activities
Region:
Type: String
Default: eu-west-2
AWSEnv:
Type: String
Default: AWS
Resources:
CreateActivityFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: myapp
Handler: app.lambda_handler
Runtime: python3.8
Environment:
Variables:
DYNAMO_DB_REGION: localhost
DYNAMO_DB_ENDPOINT: http://localhost:8000
DYNAMO_DB_KEY: local
DYNAMO_DB_SECRET: local
CHATBOT_API_KEY: CHATBOT_API_KEY
CHATBOT_API_SECRET: CHATBOT_API_SECRET
Events:
CreateActivities:
Type: Api
Properties:
Path: /
Method: post
Outputs:
ActivitiesApi:
Description: "API Gateway endpoint URL for Prod stage for Create Activity Function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/activities/"
Код: Выделить всё
sam local start-lambda
Код: Выделить всё
version: "3.8"
name: ${APP_NAME}
services:
# PHP APPS
php_app:
container_name: ${APP_NAME}
build:
context: .
dockerfile: ./dockerfiles/Dockerfile
args:
- COMPOSER_VERSION=latest
- XDEBUG_VERSION=latest
- PHP_VERSION=8.3
volumes:
- "php_app:/var/www/html"
networks:
private:
env_file: env/php.env
# Supportive services
nginx:
image: nginx
networks:
private:
public:
ipv4_address: ${IP_BASE}.2
volumes:
- "php_app:/var/www/html"
- "./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
- "./ssl/certs/www.crt:/etc/nginx/ssl/www.crt:ro"
- "./ssl/certs/www.key:/etc/nginx/ssl/www.key:ro"
# Rest of services Here
volumes:
php_app:
driver: local
driver_opts:
type: none
o: bind
device: ${PHP_APP_PATH}
networks:
private:
public:
ipam:
config:
- subnet: ${IP_BASE}.0/24
gateway: ${IP_BASE}.1
Подробнее здесь: https://stackoverflow.com/questions/791 ... ompose-yml
Мобильная версия