Issue with login when running from inside of a devcontainer #1228
Unanswered
han-so1omon
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
sudo echo "127.0.0.1 local.myhost
Description
I am running this from a devcontainer. My devcontainer is setup using the file shown in the Example Code section. It is running Docker-in-Docker, from the standard microsoft devcontainer base, with features for Python, Node, and Docker-in-Docker. My .env file for docker compose is shown in the Example Code section as well
When I run from my host OS (Mac OS), I can run docker compose up, then login as expected. When I run from my devcontainer, I get a CORS error upon trying to login. I can access /login, /docs, /redoc, the adminer page (incl logging in), and the traefik page with no issue. I have also disabled CORS and done a test on the /api/v1/login/access-token url with the first_superuser name and password, and this works correctly. When I try to login via the /login page, though, even with CORS allow all origins, it yields the following in the browser:
I have a suspicion that this has to do with the local.myhost name not being resolved correctly from within the devcontainer or docker compose environment, but I'm not sure. Does anyone have an idea of what is the issue?
Operating System
macOS
Operating System Details
Host: MacOS 14.3.1
Devcontainer: mcr.microsoft.com/devcontainers/base:bookworm with Docker in Docker, Python 3.11, Poetry, and Node
Python Version
3.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions