-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug Fix] unable to login Docker #3040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Able to log in on docker
allows server to be built and actually usable on docker
add the build arg
clear up non needed tasks
|
Can someone review this issue please? |
|
This works for me. The docker-compose.yml file can be something like this. |
Dockerfile
Outdated
| # Set up config file and disable atomic by default | ||
| RUN python3 -c "import app; import app.utility.config_generator; app.utility.config_generator.ensure_local_config();"; \ | ||
| sed -i '/\- atomic/d' conf/local.yml; | ||
| # Set up config file and dont disable atomic by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: it should be "don't"
alternatively skip the negative part of the comment altogether:
| # Set up config file and dont disable atomic by default | |
| # Set up config file |
Dockerfile
Outdated
|
|
||
| # Set up config file and disable atomic by default | ||
| RUN python3 -c "import app; import app.utility.config_generator; app.utility.config_generator.ensure_local_config();"; \ | ||
| sed -i '/\- atomic/d' conf/local.yml; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why atomic was being disabled previously?
Dockerfile
Outdated
| apt-get autoremove -y && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
| apt-get install -y nodejs npm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this change will not build the magma plugin - is that right?
server.py
Outdated
| def configure_magma_env_file(): | ||
| logging.info("Setting VueJS environment file.") | ||
| url = BaseWorld.get_config("app.frontend.api_base_url") | ||
| logging.info(f"Successfuly set {url} as base url.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
| logging.info(f"Successfuly set {url} as base url.") | |
| logging.info(f"Successfully set {url} as base url.") |
| subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True) | ||
| logging.info("VueJS front-end build complete.") | ||
| app_svc.application.on_response_prepare.append(enable_cors) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intentionally removing the blank line and nothing else?
|
im not going to lie i completely forgot everything, i did this pull request when i was doing my university project. Hopefully everything goes well. |
|
Are you still seeing this issue with the latest version of Dockerfile? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a Docker login issue where the Vue.js frontend was being built before the environment file was created, preventing users from logging in. The fix moves the frontend build process to runtime and updates Docker configuration to support the --build flag.
- Modified Docker build process to defer Vue.js frontend compilation until runtime
- Updated documentation to include the
--buildflag when running the Docker container - Added logging to track environment file configuration
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server.py | Added logging for environment configuration and cleaned up whitespace |
| README.md | Updated Docker run command to include --build flag |
| Dockerfile | Removed build-time frontend compilation and kept Node.js/npm for runtime builds |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server.py
Outdated
| def configure_magma_env_file(): | ||
| logging.info("Setting VueJS environment file.") | ||
| url = BaseWorld.get_config("app.frontend.api_base_url") | ||
| logging.info(f"Successfuly set {url} as base url.") |
Copilot
AI
Sep 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a spelling error in the log message. 'Successfuly' should be 'Successfully'.
| logging.info(f"Successfuly set {url} as base url.") | |
| logging.info(f"Successfully set {url} as base url.") |
|



[BUG] Docker not being able to log in
Docker front end being built before running and writing the env file, which causes users not being able to login. ./Magna/.env needs to exist before building,which doesnt happen for docker
Bug fix
Removed Previous Dockerfile
downloaded new one and built it (docker build . --build-arg WIN_BUILD=true -t caldera:latest
)
then to run the docker image i ran:
docker run -p 8888:8888 caldera:latest --build
then i accessed the web page according my base url i set in the local.yml file
logged in successfully according to my local.yml credentials :)