From 811e7771ccbdc8c1ccb47d93892652fdf68b8943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Tue, 3 Jan 2023 13:04:05 +0100 Subject: [PATCH] Run Dockerfile via entrypoint.sh --- Dockerfile | 4 ++-- entrypoint.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index e2559eb..a1d2fc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN git clone https://git.kucharczyk.xyz/lukas/timetracker.git /home/timetracker WORKDIR /home/timetracker/app RUN chown -R timetracker /home/timetracker/app RUN poetry install -RUN make migrate && make loadplatforms EXPOSE 8000 USER timetracker -CMD [ "python3", "src/web/manage.py", "runserver", "0.0.0.0:8000" ] \ No newline at end of file +ENTRYPOINT [ "entrypoint.sh" ] +# CMD [ "python3", "src/web/manage.py", "runserver", "0.0.0.0:8000" ] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..5ea3aa9 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/env bash +# Apply database migrations +echo "Apply database migrations" +python manage.py migrate + +# Start server +echo "Starting server" +python manage.py runserver 0.0.0.0:8000 \ No newline at end of file