-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (28 loc) · 847 Bytes
/
Dockerfile
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
# Use Python base image for local development
FROM python:3.9-slim AS base
# Set working directory
WORKDIR /app
# Copy requirements file
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy environment files if they exist
COPY .env* ./
# Copy function code
COPY sync.py .
COPY scripts ./scripts/
# Create logs directory
RUN mkdir -p logs && chmod 777 logs
# Default command for local development
CMD ["python", "sync.py"]
# Lambda-specific build
FROM public.ecr.aws/lambda/python:3.9 AS lambda
# Copy requirements.txt
COPY requirements.txt ${LAMBDA_TASK_ROOT}/
# Install the specified packages
RUN pip install -r requirements.txt
# Copy function code
COPY app.py ${LAMBDA_TASK_ROOT}/app.py
COPY sync.py ${LAMBDA_TASK_ROOT}/sync.py
# Set the CMD to your handler
CMD [ "app.handler" ]