FastAPI-template icon indicating copy to clipboard operation
FastAPI-template copied to clipboard

Fixes ncurses problem and reduces image size.

Open emorozov opened this issue 2 years ago • 2 comments
trafficstars

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).

emorozov avatar Apr 26 '23 19:04 emorozov

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

s3rius avatar Apr 26 '23 19:04 s3rius

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 "[email protected]"

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.

s3rius avatar Apr 26 '23 19:04 s3rius