Skip to content
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

[Bug Fix] unable to login Docker #3040

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Blipblopblopblop
Copy link

[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 :)

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
@BurnyMack
Copy link

Can someone review this issue please?

@dickens88
Copy link

This works for me. The docker-compose.yml file can be something like this.

services:
  caldera:
    image: caldera:latest
    build: . 
    ports:
      - "8888:8888"
    command: ["--build"]  
``

# 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
Copy link

@rfulwell rfulwell Nov 26, 2024

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:

Suggested change
# Set up config file and dont disable atomic by default
# Set up config file

@@ -27,9 +27,9 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install pip requirements
RUN pip3 install --no-cache-dir -r requirements.txt

# 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;

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?

apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
apt-get install -y nodejs npm

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?

@@ -150,6 +150,7 @@ async def start_vue_dev_server():
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.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick:

Suggested change
logging.info(f"Successfuly set {url} as base url.")
logging.info(f"Successfully set {url} as base url.")

@@ -265,8 +266,7 @@ def list_str(values):
logging.info("Building VueJS front-end.")
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)

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?

@Blipblopblopblop
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants