Skip to content

Commit 7c93d01

Browse files
committed
SDK-1056: Install local SDK in Dockerfiles for example projects
1 parent dfdfedc commit 7c93d01

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

examples/yoti_example_django/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ ARG YOTI_KEY_FILE_PATH
55
RUN if [ "$YOTI_SCENARIO_ID" = "yourScenarioId" ] ; then echo YOTI_SCENARIO_ID not set; exit 1; else echo YOTI_SCENARIO_ID is $YOTI_SCENARIO_ID ; fi
66
RUN if [ "$YOTI_CLIENT_SDK_ID" = "yourClientSdkId" ] ; then echo YOTI_CLIENT_SDK_ID not set; exit 1; else echo YOTI_CLIENT_SDK_ID is $YOTI_CLIENT_SDK_ID ; fi
77
RUN if [ "$YOTI_KEY_FILE_PATH" = "yourKeyFilePath" ] ; then echo YOTI_KEY_FILE_PATH not set; exit 1; else echo YOTI_KEY_FILE_PATH is $YOTI_KEY_FILE_PATH ; fi
8-
ADD . /code
9-
WORKDIR /code
8+
ADD . /yoti-sdk
9+
WORKDIR /yoti-sdk/examples/yoti_example_django/
10+
RUN pip install --no-cache-dir -r /yoti-sdk/requirements.txt && pip install /yoti-sdk
1011
RUN pip install --no-cache-dir -r requirements.txt
1112
ENV YOTI_SCENARIO_ID $YOTI_SCENARIO_ID
1213
ENV YOTI_CLIENT_SDK_ID $YOTI_CLIENT_SDK_ID
1314
ENV YOTI_KEY_FILE_PATH $YOTI_KEY_FILE_PATH
1415

1516
RUN python manage.py migrate
16-
CMD ["python", "manage.py", "runsslserver", "0.0.0.0:5000"]
17+
CMD ["python", "manage.py", "runsslserver", "0.0.0.0:5000"]

examples/yoti_example_django/docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ version: '3.4'
22
services:
33
web:
44
build:
5-
context: ./
5+
context: ../../
6+
dockerfile: examples/yoti_example_django/Dockerfile
67
args:
78
YOTI_SCENARIO_ID: "${YOTI_SCENARIO_ID}"
89
YOTI_CLIENT_SDK_ID: "${YOTI_CLIENT_SDK_ID}"

examples/yoti_example_flask/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ ARG YOTI_KEY_FILE_PATH
55
RUN if [ "$YOTI_SCENARIO_ID" = "yourScenarioId" ] ; then echo YOTI_SCENARIO_ID not set; exit 1; else echo YOTI_SCENARIO_ID is $YOTI_SCENARIO_ID ; fi
66
RUN if [ "$YOTI_CLIENT_SDK_ID" = "yourClientSdkId" ] ; then echo YOTI_CLIENT_SDK_ID not set; exit 1; else echo YOTI_CLIENT_SDK_ID is $YOTI_CLIENT_SDK_ID ; fi
77
RUN if [ "$YOTI_KEY_FILE_PATH" = "yourKeyFilePath" ] ; then echo YOTI_KEY_FILE_PATH not set; exit 1; else echo YOTI_KEY_FILE_PATH is $YOTI_KEY_FILE_PATH ; fi
8-
ADD . /code
9-
WORKDIR /code
8+
ADD . /yoti-sdk
9+
WORKDIR /yoti-sdk/examples/yoti_example_flask/
10+
RUN pip install --no-cache-dir -r /yoti-sdk/requirements.txt && pip install /yoti-sdk
1011
RUN pip install --no-cache-dir -r requirements.txt
11-
CMD ["python", "app.py"]
12+
CMD ["python", "app.py"]

examples/yoti_example_flask/docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ version: '3.4'
22
services:
33
web:
44
build:
5-
context: ./
5+
context: ../../
6+
dockerfile: examples/yoti_example_flask/Dockerfile
67
args:
78
YOTI_SCENARIO_ID: "${YOTI_SCENARIO_ID}"
89
YOTI_CLIENT_SDK_ID: "${YOTI_CLIENT_SDK_ID}"

0 commit comments

Comments
 (0)