Skip to content

Commit 45d0a3d

Browse files
Update to use entrypoint
Signed-off-by: Jacob Woffenden <[email protected]>
1 parent fb23099 commit 45d0a3d

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM ghcr.io/ministryofjustice/analytical-platform-airflow-python-base:1.6.0
22

33
COPY requirements.txt requirements.txt
4-
COPY src/main.py main.py
4+
COPY src/ .
55
RUN <<EOF
66
pip install --no-cache-dir --requirement requirements.txt
77
EOF
88

9-
ENTRYPOINT ["python3", "main.py"]
9+
ENTRYPOINT ["bash", "entrypoint.sh"]

src/entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
MODE="${MODE:-basic}"
4+
5+
case "${MODE}" in
6+
basic)
7+
echo "Running in basic mode"
8+
env
9+
aws sts get-caller-identity
10+
;;
11+
benchmark)
12+
echo "Running in benchmark mode"
13+
env
14+
aws sts get-caller-identity
15+
python3 main.py
16+
;;
17+
*)
18+
echo "Unknown mode: ${MODE}"
19+
exit 1
20+
;;
21+
esac

0 commit comments

Comments
 (0)