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

Add development environment using docker compose #30

Merged
merged 8 commits into from
Apr 26, 2023

Conversation

yenienserrano
Copy link
Member

@yenienserrano yenienserrano commented Feb 27, 2023

Description

Added the development environment to manage issues in Wazuh-dashboard.

Issues Resolved

Test

You must be able to log in to wazuh-dashboards with the environments.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@yenienserrano yenienserrano linked an issue Feb 27, 2023 that may be closed by this pull request
1 task
@yenienserrano yenienserrano changed the title Add the development environment Wazuh-dashboards Add the development environment for Wazuh-dashboards Feb 27, 2023
docker/dev.sh Outdated Show resolved Hide resolved
docker/dev.yml Outdated Show resolved Hide resolved
@AlexRuiz7 AlexRuiz7 changed the title Add the development environment for Wazuh-dashboards Add development environment using docker compose Apr 13, 2023
Copy link
Member

@AlexRuiz7 AlexRuiz7 left a comment

Choose a reason for hiding this comment

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

The proposed solution only works for published versions of OpenSearch as it is based on the Docker images published by them on each release, so we cannot use versions under development using this approach.

I've developed a variant that uses the OpenSearch snapshots, which are generated even for versions under development. The problem is that the snapshots are minimal and do not include any additional plugins, not even the security one, so we cannot use our security plugin in the frontend neither, unlike the solution added here.

As both solutions have advantages and disadvantages, we'll keep both, so we can decide which version to start (with or without security) depending on the situation.

We'll eventually upgrade these tools if we see fit, hopefully solving the limitations of both partial solutions.

version: "3.9"

services:
  # Runs the bootstrap and exits
  installer:
    image: node:${NODE_VERSION}
    container_name: installer
    volumes:
      - ${REPO_PATH}:/home/node/app
      # - ${SECURITY_PLUGIN_REPO_PATH}:/home/node/app/plugins/security
    user: "1000:1000"
    working_dir: /home/node/app
    command: >
      /bin/bash -c "
        yarn osd bootstrap
      "

  wazuh-dashboard:
    image: node:${NODE_VERSION}
    container_name: wazuh-dashboard
    depends_on:
      installer:
        condition: service_completed_successfully
    ports:
      - 5601:5601 # Map host port 5601 to container port 5601
    expose:
      - "5601" # Expose port 5601 for web access to Wazuh Dashboard
    volumes:
      - ${REPO_PATH}:/home/node/app
      # - ${SECURITY_PLUGIN_REPO_PATH}:/home/node/app/plugins/security
    user: "1000:1000"
    working_dir: /home/node/app
    command: >
      /bin/bash -c "
        yarn opensearch snapshot
      "

docker/dev.sh Outdated Show resolved Hide resolved
Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

review

🟢 code

@AlexRuiz7 AlexRuiz7 force-pushed the 21-create-development-docker branch from ef94275 to 4a5862e Compare April 20, 2023 11:49
@AlexRuiz7 AlexRuiz7 mentioned this pull request Apr 20, 2023
19 tasks
@AlexRuiz7 AlexRuiz7 merged commit b367750 into 2.4.1 Apr 26, 2023
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.

Create docker-compose development environment
3 participants