whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.
MIT License
231 stars 47 forks source link

Build does not complete - variables not set in docker-compose.yml? #22

Closed roland-jungwirth closed 1 year ago

roland-jungwirth commented 1 year ago

I am trying to get this to run on my local development machine (Intel MacBook Pro, Docker Desktop), but although the cookiecutter completes correctly, the docker-compose build --no-cache fails with the following error message:

=> [auth] library/node:pull token for registry-1.docker.io                                                                                                                                  0.0s
failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF

Checking the docker-compose.yml file, I see a lot of Variable not set mentions - see attached file which I had to rename to .txt).

Any ideas how I can debug this?

docker-compose.txt

turukawa commented 1 year ago

I'm not immediately sure of what the problem may be. Did you make any edits to the file (even as much as opening, saving, and closing) because there seem to be some tab/space errors? I have had Docker scream because of mixed tabs and spaces for formatting.

Also, is yours a recent version of Docker?

The variable not set will just pull from your .env on build. E.g. ${TRAEFIK_TAG?Variable not set} will pull TRAEFIK_TAG. The error message you'd get if it was a problem and the variable was not set would be Variable not set. You'll see in other places that the alternative isn't a message but a default value.

UPDATE: Check this Docker issue ... may be a version / Mac combo.

roland-jungwirth commented 1 year ago

Thank you for your answer, turukawa.

I did not make any updates to the files, and just ran one command after the other. I am aware that there seem to be / are issues with Docker on Mac - mainly because of the abstraction OSX does (https://markshust.com/2018/12/30/docker-mac-filesystem-volume-mount-approach-performance/). However, I am definitely not an expert.

For the record, I am running the most recent version of Docker Desktop.

I'll check out the Docker issue, maybe that will fix it. Other than that, I'll probably just install Linux somewhere. Is it possible to run this stack inside one Docker container?

turukawa commented 1 year ago

From the looks of things with that issue, you need to downgrade to a version previous to the issue occurring.

It's possible to run FastAPI from a single image. Check out the source Inboard images. However, at that point you're going to need to decide how to deploy any other components you may need (database, frontend, etc).

roland-jungwirth commented 1 year ago

Yup, downgrading to Docker Desktop 4.14.0 from last year worked. Thank you for your help.