forked from aws-samples/bedrock-claude-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (73 loc) · 2.28 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: "3.9"
services:
ui:
build:
context: frontend
dockerfile: Dockerfile
ports:
- 5173:5173
environment:
VITE_APP_API_ENDPOINT: http://localhost:8000
VITE_APP_USER_POOL_ID: ap-southeast-2_XXXXXXXXX
VITE_APP_USER_POOL_CLIENT_ID: replace_with_your_client_id
VITE_APP_REGION: ap-southeast-2
VITE_APP_USE_STREAMING: false # ローカル開発時は websocket を利用しない
volumes:
- "./frontend/src:/app/src"
api:
build:
context: backend
dockerfile: Dockerfile
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
ports:
- 8000:8000
environment:
DDB_ENDPOINT_URL: http://dynamodb-local:8080
TABLE_NAME: ConversationTable
# Bedrock 向けの設定
BEDROCK_REGION: ap-southeast-2
#AWS_ACCESS_KEY_ID: XXXX
#AWS_SECRET_ACCESS_KEY: XXXX
volumes:
- "~/.aws:/root/.aws" # ローカルのクレデンシャルの利用に必要
- "./backend/app:/backend/app"
depends_on:
- dynamodb-local
dynamodb-local:
image: public.ecr.aws/aws-dynamodb-local/aws-dynamodb-local:1.22.0
command: "-jar DynamoDBLocal.jar -port 8080"
ports:
- 8080:8080
# 初期テーブル作成用のコンテナ
init-dynamodb:
image: public.ecr.aws/aws-cli/aws-cli:latest
environment:
AWS_REGION: ap-southeast-2
AWS_ACCESS_KEY_ID: key
AWS_SECRET_ACCESS_KEY: key
depends_on:
- dynamodb-local
command: >
dynamodb create-table --table-name ConversationTable
--attribute-definitions
AttributeName=PK,AttributeType=S
AttributeName=SK,AttributeType=S
--key-schema
AttributeName=PK,KeyType=HASH
AttributeName=SK,KeyType=RANGE
--global-secondary-indexes
IndexName=SKIndex,KeySchema=[{'AttributeName=SK,KeyType=HASH'}],Projection={ProjectionType=ALL}
--billing-mode PAY_PER_REQUEST
--endpoint-url http://dynamodb-local:8080
# DynamoDB Local 向けの GUI
#dynamodb-admin:
# image: aaronshaf/dynamodb-admin
# ports:
# - 8001:8001
# depends_on:
# - dynamodb-local
# environment:
# AWS_REGION: ap-southeast-2
# AWS_ACCESS_KEY_ID: key
# AWS_SECRET_ACCESS_KEY: key
# DYNAMO_ENDPOINT: http://dynamodb-local:8080