full-stack-fastapi-template
full-stack-fastapi-template copied to clipboard
"docker-compose up -d" works on ubuntu but does not work on mac.
This is the terminal output:
docker-compose up -d unexpected character " \ "" in variable name near ""http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.app", "https://sta.app", "https://mi.app", "http://local.dockertoolbox.tiangolo.com", "http://localhost.tiangolo.com"]\nPROJECT_NAME=mifarma\nSECRET_KEY=pswd\nFIRST_SUPERUSER=me\nFIRST_SUPERUSER_PASSWORD=pswd\nSMTP_TLS=False\nSMTP_SSL=True\nSMTP_PORT=465\nSMTP_HOST=smt\[email protected]\nSMTP_PASSWORD=pswd\[email protected]\n\nSENTRY_DSN=\n\n# Flower\nFLOWER_BASIC_AUTH=admin:pswd\n\n# Postgres\nPOSTGRES_SERVER=db\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=password\nPOSTGRES_DB=app\n\n# PgAdmin\nPGADMIN_LISTEN_PORT=5050\[email protected]\nPGADMIN_DEFAULT_PASSWORD=password\n"
The culprit should be in this code (?) even though it works on ubuntu. I've cleared the code of confidential and possibly sensible information but no lines have been erased, only modified.
------------------------------------------CODE------------------------------------------
DOMAIN=localhost
# DOMAIN=local.dockertoolbox.tiangolo.com
# DOMAIN=localhost.tiangolo.com
# DOMAIN=mi.app
STACK_NAME=mi-app
TRAEFIK_PUBLIC_NETWORK=traefik-public
TRAEFIK_TAG=jjj.ap
TRAEFIK_PUBLIC_TAG=traefik-public
DOCKER_IMAGE_BACKEND=b_backend
DOCKER_IMAGE_CELERYWORKER=b_celeryworker
DOCKER_IMAGE_FRONTEND=b_frontend
# Backend
BACKEND_CORS_ORIGINS= ["http://172.19.36.52:8080", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://mi.app", "https://mi.app", "https://mi.app", "http://local.dockertoolbox.tiangolo.com", "http://localhost.tiangolo.com"]
PROJECT_NAME=Oppenheiser
SECRET_KEY=super_secret_key
FIRST_SUPERUSER=god
FIRST_SUPERUSER_PASSWORD=pswd
SMTP_TLS=False
SMTP_SSL=True
SMTP_PORT=465
SMTP_HOST=priv
SMTP_USER=mail
SMTP_PASSWORD=pswd
EMAILS_FROM_EMAIL=email
SENTRY_DSN=
# Flower
FLOWER_BASIC_AUTH=admin:pswd
# Postgres
POSTGRES_SERVER=db
POSTGRES_USER=postgres
POSTGRES_PASSWORD=pswd
POSTGRES_DB=app
# PgAdmin
PGADMIN_LISTEN_PORT=5050
[email protected]
PGADMIN_DEFAULT_PASSWORD=psd
maybe double quotes are not allowed in env vars:
BACKEND_CORS_ORIGINS= ["http://172.19.36.52:8080", "http://localhost:8080", "https:...
maybe this will work?
BACKEND_CORS_ORIGINS= ['http://172.19.36.52:8080', 'http://localhost:8080', 'https:...
What docker/compose versions are you using? Are you using the same for Mac and Ubuntu?
$ docker --version
$ docker-compose --version
FYI I'm here because it seems that docker-compose cannot parse "." in the variable name. Only recently started happening
$ docker --version
Docker version 20.10.8, build 3967b7d
$ docker-compose --version
Docker Compose version v2.0.0
Thank you both. I ended up testing a few solutions by modifying the BACKEND_CORS_ORIGIN and replaced it with :
BACKEND_CORS_ORIGINS= ["http://localhost:8080","http://172.19.36.52:8080","http://localhost","http://localhost:4200","http://localhost:3000","http://dev.mifarmacia.app","https://stag.mifarmacia.app","https://mifarmacia.app","http://local.dockertoolbox.tiangolo.com","http://localhost.tiangolo.com"]
It seems to be working now. I'll add the docker and docker-compose versions. Note that my friend was using the exact same versions and had no issues.
$ docker -v
Docker version 20.10.8, build 3967b7d
$docker-compose -v
Docker Compose version v2.0.0
santa@MBP-de-Alex mifarma-api %
$ docker -v
Docker version 20.10.8, build 3967b7d
$docker-compose -v
Docker Compose version v2.0.0
The parser doesn't like the space between each array element.
Do this:
VARIABLE=["a","b","c"]
Not this:
VARIABLE=["a", "b", "c"]
Hi, I think docker compose V2 has breaking change 👇 https://docs.docker.com/compose/cli-command/
You can:
- use new command
$ docker compose
OR
- disable compose v2
$ docker-compose disable-v2
Hope it helps 😄
Hi, I think docker compose V2 has breaking change 👇 https://docs.docker.com/compose/cli-command/
You can:
- use new command
docker composeOR
- disable compose v2
docker-compose disable-v2Hope it helps 😄
This worked for me!
For me, dashes are not even allowed in .env files.
For me, dashes are not even allowed in .env files.
I had the same issue, the comment by @sylvia-shen solved it - https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/427#issuecomment-943205487
I had the same issue. Disabling docker compose v2 fixed it (docker-compose disable-v2). What's breaking this?
Docker Compose V2 has breaking changes due to which it throws the error while parsing environment file. One solution is to change the environment file by replacing all double quotes with single quotes and by wrapping these environment variables with a double quote (see this example environment file - works with V2 as well as V1.x)