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

docs: Added docker support documentation #465

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

YuvalBubnovsky
Copy link
Contributor

@YuvalBubnovsky YuvalBubnovsky commented Sep 25, 2024

User description

Description

Added docker-support.md to facilitate a designated space for docker documentation

Fixes #279

Dependencies

None.

Future Improvements

Expand when new docker features are implemented for the project.

Mentions

@rajdip-b

Screenshots of relevant screens

N/A

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

PR Type

Documentation


Description

  • Added a new documentation file docker-support.md to provide detailed instructions on building and running applications using Docker.
  • Included prerequisites for Docker installation and usage.
  • Provided specific commands for building and running the Web Application, API, and Platform using Docker.
  • Detailed port usage and environment variable requirements.
  • Instructions for starting and stopping services using Docker Compose.

Changes walkthrough 📝

Relevant files
Documentation
docker-support.md
Add Docker support documentation with usage instructions 

docs/contributing-to-keyshade/running-things-locally/docker-support.md

  • Added a new document for Docker support.
  • Included instructions for building and running applications using
    Docker.
  • Listed prerequisites and port usage details.
  • Provided commands for starting and stopping services.
  • +93/-0   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Add instructions for viewing Docker container logs to aid in troubleshooting

    Add information about viewing logs for the Docker containers, which can be helpful
    for troubleshooting.

    docs/contributing-to-keyshade/running-things-locally/docker-support.md [89-93]

     docker compose down
    +```
    +
    +## Viewing Logs
    +
    +To view logs for a specific service:
    +
    +```bash
    +docker compose logs [service_name]
    +```
    +
    +For example, to view logs for the API service:
    +
    +```bash
    +docker compose logs api

    For more detailed information about Docker usage, refer to the official Docker documentation.

    
    - [ ] **Apply this suggestion** <!-- /improve --apply_suggestion=0 -->
    
    <details><summary>Suggestion importance[1-10]: 8</summary>
    
    Why: Including log viewing instructions is a valuable addition for troubleshooting, making it easier for users to diagnose issues with their Docker containers.
    
    
    </details></details></td><td align=center>8
    
    </td></tr><tr><td>
    
    
    
    <details><summary>Explain data persistence in Docker to clarify how data is stored and managed across container restarts</summary>
    
    ___
    
    
    **Add a section about data persistence and volumes, explaining how data is stored and <br>persisted across container restarts.**
    
    [docs/contributing-to-keyshade/running-things-locally/docker-support.md [75-77]](https://github.com/keyshade-xyz/keyshade/pull/465/files#diff-ed4f7653f96a273f643129eb762cc422377a89d31c3a6fe0327f355f926c8ccaR75-R77)
    
    ```diff
     ## Environment Variables
     
     All applications use environment variables from a `.env` file. Ensure this file is present in your project root directory with the necessary configurations.
     
    +## Data Persistence
    +
    +Docker containers are ephemeral by nature. To persist data across container restarts, we use Docker volumes. The `docker-compose.yml` file defines volumes for each service that requires data persistence. These volumes are automatically created and managed by Docker.
    +
    +To list all volumes:
    +
    +```bash
    +docker volume ls
    +```
    +
    +To inspect a specific volume:
    +
    +```bash
    +docker volume inspect [volume_name]
    +```
    +
    
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Adding a section on data persistence is important for users to understand how to manage data across container restarts, making the document more comprehensive and practical.

    8
    Introduce Docker Compose earlier in the document to provide context for running all services together

    Consider adding a section about Docker Compose for running all services together, as
    it's mentioned in the "Starting and Stopping Services" section but not explained
    earlier.

    docs/contributing-to-keyshade/running-things-locally/docker-support.md [13-21]

     ## Available Applications
     
     We have Docker support for the following applications:
     
     1. Web Application
     2. API
     3. Platform
     
    +These applications can be run individually or together using Docker Compose.
    +
     ## Building and Running Applications
     
    +### Individual Applications
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion improves the document by providing context for Docker Compose usage earlier, enhancing clarity for users who may want to run all services together.

    7
    Explain Docker networking to clarify how the services interact within the Docker environment

    Include information about Docker network creation and how the services communicate
    with each other within the Docker environment.

    docs/contributing-to-keyshade/running-things-locally/docker-support.md [65-73]

    -## Port Usage
    +## Port Usage and Networking
     
     The applications use the following ports by default:
     
     - Web Application: 3000
     - API: 4200
     - Platform: 3025
     
     Ensure these ports are available on your system. If you need to use different ports, you can modify the port mappings in the `package.json` file locally.
     
    +When running with Docker Compose, these services are connected to a common network, allowing them to communicate with each other using their service names as hostnames.
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion provides useful information about Docker networking, which helps users understand how services communicate, enhancing the document's completeness.

    7

    💡 Need additional feedback ? start a PR chat

    @YuvalBubnovsky
    Copy link
    Contributor Author

    PR Code Suggestions ✨

    Category Suggestion Score
    Enhancement
    Add instructions for viewing Docker container logs to aid in troubleshooting

    8
    Introduce Docker Compose earlier in the document to provide context for running all services together

    7
    Explain Docker networking to clarify how the services interact within the Docker environment

    7

    💡 Need additional feedback ? start a PR chat

    I agree with introducing docker compose earlier in the document.

    but I'm not sure about the other comments, for example: adding an instruction on how to view docker logs is something you would likely see in a general docker documentation, not in a project specific one (especially if we don't even have a command for it in package.json)
    Same goes for explaining docker networking, I do not think this is something that should be added in this documentation.

    But of course, if you believe these will be good additions I'll get to it.

    Waiting on feedback for this.

    @rajdip-b
    Copy link
    Member

    I agree with introducing docker compose earlier in the document.

    I, too, believe that this would be a useful addition. So you can go ahead and add it.

    @rajdip-b rajdip-b merged commit bc04be4 into keyshade-xyz:develop Sep 29, 2024
    5 checks passed
    Kiranchaudhary537 pushed a commit to Kiranchaudhary537/keyshade that referenced this pull request Oct 13, 2024
    rajdip-b pushed a commit that referenced this pull request Oct 24, 2024
    ## [2.6.0](v2.5.0...v2.6.0) (2024-10-24)
    
    ### 🚀 Features
    
    * **api:**  Add icon and remove description field from workspace ([#435](#435)) ([a99c0db](a99c0db))
    * **api-client:** Added workspace-membership and related tests ([#452](#452)) ([6a1c091](6a1c091))
    * **api-client:** Create controller for User module ([#484](#484)) ([f9d8e83](f9d8e83))
    * **api:** Add prod env schema in env file ([#436](#436)) ([21c3004](21c3004))
    * **api:** Add resend otp implementation ([#445](#445)) ([4dc6aa1](4dc6aa1))
    * **api:** Fetch total count of environments, [secure]s and variables in project ([#434](#434)) ([0c9e50a](0c9e50a))
    * **api:** Replace `projectId` with `name` and `slug` in workspace-role response.  ([#432](#432)) ([af06071](af06071))
    * **cli:** Add functionality to operate on Secrets ([#504](#504)) ([1b4bf2f](1b4bf2f))
    * **cli:** Add project command ([#451](#451)) ([70448e1](70448e1))
    * **cli:** Add workspace operations ([#441](#441)) ([ed38d22](ed38d22))
    * **cli:** implement commands to get, list, update, and delete, workspace roles ([#469](#469)) ([957ea8d](957ea8d))
    * **cli:** Implemented pagination support ([#453](#453)) ([feb1806](feb1806))
    * **cli:** Secret scan ([#438](#438)) ([85cb8ab](85cb8ab))
    * **cli:** Update environment command outputs ([f4af874](f4af874))
    * **platform:** Clearing email field after waitlisting the user email ([#481](#481)) ([256d659](256d659))
    * Remove project IDs from workspace role export data and update tests ([#448](#448)) ([8fdb328](8fdb328))
    * **web:** Configured extra check for waitlisted users already in the list and created toast message for them ([#492](#492)) ([2ddd0ef](2ddd0ef))
    * **web:** show the toast only when email add successfully ([#490](#490)) ([783c411](783c411))
    
    ### 🐛 Bug Fixes
    
    * **api,api-client:** Add environmentSlug in multiple places across the variable module ([#468](#468)) ([d970aff](d970aff))
    * **api:** Replace the id with slug in the global-search service ([#455](#455)) ([74804b1](74804b1))
    * **platform:** Fixed duplicate Google Logo UI fix  ([#450](#450)) ([fb0d6f7](fb0d6f7))
    * resolve footer website name cut-off or overlap issue ([#444](#444)) ([fe03ba2](fe03ba2))
    * **web:** Horizontal Scrolling issue on the website ([#440](#440)) ([655177b](655177b))
    
    ### 📚 Documentation
    
    * Add documentation for environment in CLI ([#462](#462)) ([dad7394](dad7394))
    * Add documentation for project in CLI ([#466](#466)) ([341fb32](341fb32))
    * Add documentation for scan in CLI ([#461](#461)) ([72281e6](72281e6))
    * Add documentation for workspace command ([#464](#464)) ([4aad8a2](4aad8a2))
    * Add instructions for resetting the local Prisma database ([#495](#495)) ([#501](#501)) ([b07ea17](b07ea17))
    * Added docker support documentation ([#465](#465)) ([bc04be4](bc04be4))
    * Added documentation for running the platform ([#473](#473)) ([8b8386b](8b8386b))
    * Added missing mappings to pages ([5de9fd8](5de9fd8))
    * Fix Documentation Hyperlink and update expired Discord invite link ([#496](#496)) ([5a10e39](5a10e39))
    * Updated CLI docs ([#460](#460)) ([c7e0f13](c7e0f13))
    
    ### 🔧 Miscellaneous Chores
    
    * Add more logging to Sentry init ([#470](#470)) ([de4925d](de4925d))
    * **api:** Optimise API docker image size ([#360](#360)) ([ea40dc1](ea40dc1))
    * **api:** Updated lockfile ([a968e78](a968e78))
    * **CI:** Add [secure] scan validation ([f441262](f441262))
    * **cli:** Update controller invocation in environment commands ([#477](#477)) ([596bd1a](596bd1a))
    * Minor changes to variables ([fe01ca6](fe01ca6))
    * **[secure]-scan:** Failing lint issues ([#507](#507)) ([48f45df](48f45df))
    * **[secure]-scan:** Formatted files ([5884833](5884833))
    * Update .env.example ([70ad4f7](70ad4f7))
    * Updated scripts ([9eb76a7](9eb76a7))
    * **web:** email validation ([#487](#487)) ([e8e737a](e8e737a))
    @rajdip-b
    Copy link
    Member

    🎉 This PR is included in version 2.6.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

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

    Successfully merging this pull request may close these issues.

    DOCS: Add a separate page under "Running things locally" and name it "Docker support"
    2 participants