s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.79k stars 161 forks source link

Fixes ncurses problem and reduces image size. #164

Open emorozov opened 1 year ago

emorozov commented 1 year ago

Running FastAPI-template from docker fails because simple-term-menu requires tput utility from ncurses.

Also, changed Dockerfile to use two stages build, reducing the size by 4 times (150 Mb vs 595 Mb).

s3rius commented 1 year ago

Yeah. You're right. Now it's much better. I was thinking about removing docker images, but now it's much better, thanks.

s3rius commented 1 year ago

I ran into some issues, using this new image.

Commands to reproduce:

docker build . --tag=ftem
docker run -it ftem --name myproject --api-type rest --db mysql --orm tortoise --ci none --quite

At first it complains about unknown committer.

This can be solved by adding these lines into a final image:

RUN git config --global user.name "Fastapi Template"
RUN git config --global user.email "fastapi-template@no-reply.com"

But still, it cannot find gcc and mysql_admin. So we need to add them in the final image anyway. I guess that with posgress the problem with also occur, because some libraries depend on pg-dev.