Commit
·
a7adf55
1
Parent(s):
bf7bb79
Included entrypoint.sh
Browse files- Dockerfile +3 -1
- entrypoint.sh +9 -0
- tools/auth.py +0 -2
Dockerfile
CHANGED
@@ -23,6 +23,8 @@ RUN rm requirements.txt
|
|
23 |
# Add lambda_entrypoint.py to the container
|
24 |
COPY lambda_entrypoint.py .
|
25 |
|
|
|
|
|
26 |
# Stage 2: Final runtime image
|
27 |
FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
28 |
|
@@ -59,7 +61,7 @@ COPY --from=builder /install /usr/local/lib/python3.11/site-packages/
|
|
59 |
# fi && chmod +x /entrypoint.sh
|
60 |
|
61 |
# Entrypoint helps to switch between Gradio and Lambda mode
|
62 |
-
COPY entrypoint.sh /entrypoint.sh
|
63 |
|
64 |
# Switch to the "user" user
|
65 |
USER user
|
|
|
23 |
# Add lambda_entrypoint.py to the container
|
24 |
COPY lambda_entrypoint.py .
|
25 |
|
26 |
+
COPY entrypoint.sh .
|
27 |
+
|
28 |
# Stage 2: Final runtime image
|
29 |
FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
30 |
|
|
|
61 |
# fi && chmod +x /entrypoint.sh
|
62 |
|
63 |
# Entrypoint helps to switch between Gradio and Lambda mode
|
64 |
+
#COPY entrypoint.sh /entrypoint.sh
|
65 |
|
66 |
# Switch to the "user" user
|
67 |
USER user
|
entrypoint.sh
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
|
3 |
+
if [ "$APP_MODE" = "lambda" ]; then
|
4 |
+
echo "Starting in Lambda mode..."
|
5 |
+
exec python -m awslambdaric "$@"
|
6 |
+
else
|
7 |
+
echo "Starting in Gradio mode..."
|
8 |
+
exec python app.py "$@"
|
9 |
+
fi
|
tools/auth.py
CHANGED
@@ -9,8 +9,6 @@ print(f'The value of AWS_CLIENT_ID is {client_id}')
|
|
9 |
user_pool_id = get_or_create_env_var('AWS_USER_POOL_ID', '')
|
10 |
print(f'The value of AWS_USER_POOL_ID is {user_pool_id}')
|
11 |
|
12 |
-
|
13 |
-
|
14 |
def authenticate_user(username:str, password:str, user_pool_id:str=user_pool_id, client_id:str=client_id):
|
15 |
"""Authenticates a user against an AWS Cognito user pool.
|
16 |
|
|
|
9 |
user_pool_id = get_or_create_env_var('AWS_USER_POOL_ID', '')
|
10 |
print(f'The value of AWS_USER_POOL_ID is {user_pool_id}')
|
11 |
|
|
|
|
|
12 |
def authenticate_user(username:str, password:str, user_pool_id:str=user_pool_id, client_id:str=client_id):
|
13 |
"""Authenticates a user against an AWS Cognito user pool.
|
14 |
|