From 63f8a98dfab94dacc22b8206974c6468145048c1 Mon Sep 17 00:00:00 2001 From: ducklet Date: Mon, 20 May 2024 16:52:37 +0200 Subject: [PATCH] feat: run alembic patches at container start --- Dockerfile | 7 +++++-- entrypoint.sh | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 66014c6..1571d75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,15 +18,18 @@ RUN pip install --no-cache-dir --upgrade \ USER 10000:10001 -COPY run ./ +COPY alembic.ini entrypoint.sh pyproject.toml run ./ +COPY alembic ./alembic COPY scripts ./scripts COPY unwind ./unwind +RUN pip install --no-cache-dir --editable . + ENV UNWIND_DATA="/data" VOLUME $UNWIND_DATA ENV UNWIND_PORT=8097 EXPOSE $UNWIND_PORT -ENTRYPOINT ["/var/app/run"] +ENTRYPOINT ["/var/app/entrypoint.sh"] CMD ["server"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..7df7daa --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eu + +alembic upgrade head +exec ./run "$@"