feat:DockerFileを作成したため、DockerFile資材を追加した

This commit is contained in:
*lcOeIaePm0 2021-10-13 10:56:56 +09:00
parent 3558564def
commit 787cacf431
3 changed files with 30 additions and 0 deletions

10
ecs/Dockerfile/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM python:3.9
ENV TZ="Asia/Tokyo"
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py ./
CMD [ "python", "./main.py" ]

19
ecs/Dockerfile/main.py Normal file
View File

@ -0,0 +1,19 @@
import boto3
import os
from os import path
# EVENT_BUCKET = os.environ["EVENT_BUCKET"]
# EVENT_OBJECKT_KEY = os.environ["EVENT_OBJECKT_KEY"]
# DESTINATION_BUCKET = os.environ["DESTINATION_BUCKET"]
# DESTINATION_OBJECKT_DIR = os.environ["DESTINATION_OBJECKT_DIR"]
# s3 = boto3.resource("s3")
# destination_object_key = path.join(
# DESTINATION_OBJECKT_DIR, path.basename(EVENT_OBJECKT_KEY)
# )
# event_object = s3.Object(DESTINATION_BUCKET, destination_object_key)
# event_object.copy({"Bucket": EVENT_BUCKET, "Key": EVENT_OBJECKT_KEY})
print('呼び出し成功')

View File

@ -0,0 +1 @@
boto3