From d458c1866bbd2ba6cdc3c9ceb73b66a1b5c2f6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:14:08 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=A7=20Use=20plain=20base=20officia?= =?UTF-8?q?l=20Python=20Docker=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 716aa231ad..c0cb015dde 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10 +FROM python:python3.10 WORKDIR /app/ From 8477bc804c75a8d0016803411e996c691b4311d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:15:37 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Use=20offical=20Python?= =?UTF-8?q?=20Docker=20image=20as=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index c0cb015dde..b9e1d0f554 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM python:python3.10 +FROM python:3.10 WORKDIR /app/ From b4f800a45d12bee6c39b53bc0d528edeacfec2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:27:39 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=9A=9A=20Move=20prestart.sh=20to=20sc?= =?UTF-8?q?ripts,=20as=20it's=20no=20longer=20needed=20at=20the=20top=20le?= =?UTF-8?q?vel=20with=20base=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 2 -- backend/{ => scripts}/prestart.sh | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename backend/{ => scripts}/prestart.sh (59%) diff --git a/backend/Dockerfile b/backend/Dockerfile index b9e1d0f554..ce00280c71 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -21,8 +21,6 @@ COPY ./scripts/ /app/ COPY ./alembic.ini /app/ -COPY ./prestart.sh /app/ - COPY ./tests-start.sh /app/ COPY ./app /app/app diff --git a/backend/prestart.sh b/backend/scripts/prestart.sh similarity index 59% rename from backend/prestart.sh rename to backend/scripts/prestart.sh index fc1e5f1890..1b395d513f 100644 --- a/backend/prestart.sh +++ b/backend/scripts/prestart.sh @@ -1,10 +1,13 @@ #! /usr/bin/env bash +set -e +set -x + # Let the DB start -python /app/app/backend_pre_start.py +python app/backend_pre_start.py # Run migrations alembic upgrade head # Create initial data in DB -python /app/app/initial_data.py +python app/initial_data.py From 728f0f98b811697e157bccb0e115e2f7ad630141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:28:06 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=93=9D=20Update=20mention=20of=20pres?= =?UTF-8?q?tart.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index e7782d43e6..53381a41ca 100644 --- a/backend/README.md +++ b/backend/README.md @@ -155,7 +155,7 @@ If you don't want to use migrations at all, uncomment the lines in the file at ` SQLModel.metadata.create_all(engine) ``` -and comment the line in the file `prestart.sh` that contains: +and comment the line in the file `scripts/prestart.sh` that contains: ```console $ alembic upgrade head From 6092983db5fcefade3453502939fae9ae83715b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:28:24 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=A7=20Update=20command=20in=20pres?= =?UTF-8?q?tart=20to=20use=20new=20location=20scripts/prestart.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ce92e3e3d7..db168b89cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,7 +55,7 @@ services: db: condition: service_healthy restart: true - command: bash prestart.sh + command: bash scripts/prestart.sh env_file: - .env environment: From 28507ca3eda4d47b2968cfaeb9cb7662a70fc613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Sep 2024 17:36:00 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=A7=20Fix=20prestart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index db168b89cb..ce92e3e3d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,7 +55,7 @@ services: db: condition: service_healthy restart: true - command: bash scripts/prestart.sh + command: bash prestart.sh env_file: - .env environment: