-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 1.06 KB
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
## Base stage with dependencies
FROM python:3.14-slim AS base
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY lib/ ./lib/
COPY api/ ./api/
COPY main.py .
COPY lambda_function.py .
## Development stage
FROM base AS development
RUN apt-get update && apt-get install -y \
libsndfile1 \
libatomic1 \
&& rm -rf /var/lib/apt/lists/*
COPY api/ ./api/
COPY main.py .
RUN mkdir -p /app/audio/input /app/audio/output
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
## Lambda stage
FROM public.ecr.aws/lambda/python:3.13 AS lambda
# Install required system libraries for Pedalboard
RUN dnf install -y libatomic libsndfile && dnf clean all
COPY --from=base /usr/local/lib/python3.13/site-packages /var/lang/lib/python3.13/site-packages
COPY --from=base /app/lib ${LAMBDA_TASK_ROOT}/lib
COPY --from=base /app/api ${LAMBDA_TASK_ROOT}/api
COPY --from=base /app/main.py ${LAMBDA_TASK_ROOT}/
COPY --from=base /app/lambda_function.py ${LAMBDA_TASK_ROOT}/
CMD ["lambda_function.handler"]