Giter Club home page Giter Club logo

docker-tools's People

Contributors

antonshmigel avatar coreyasmith avatar gwdt avatar jeanfrancoislarente avatar michaelbaranov avatar mwillebrands avatar mwillebrandscreates avatar navancommits avatar nickwesselman avatar olegjytnik avatar peternazarov avatar sc-artempychenko avatar sc-olenanosenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-tools's Issues

Development-only configuration transforms and patches

As a developer, I'd like to configure my Sitecore environment in a way that's optimal for development, so that I can have a faster development environment and an easier debugging experience.

Concept

Allow configuration of development-specific Web.config transforms and App_Config patches in the development entrypoint. Docker Tools would provide some of the essentials, but developers could add others.

Transforms/patches would be organized into folders, and the folder names could be used to enable specific patches.

Example

SITECORE_DEVELOPMENT_PATCHES=CustomErrorsOn,DebugOn,OptimizeCompilationsOn,InitializeLogsOff,DiagnosticsOff,RobotDetectionOff

Why not do this in a Dockerfile?

It allows you to have a consistent image build for dev, test, and prod, and makes these development-only transforms transient.

Is there some way to set Web.config values purely with environment variables and configBuilders?

My POC with Section Handlers was only half-successful. It's possible for customErrors but not compilation, due to availability of the app domain during configuration load.

Why an environment variable and not a entrypoint script argument?

Seems cleaner this way, but open to input on this.

Provide the ability to read dot env files and entries using PowerShell

As a developer, I'd like to use the module reading dotenv files and their values.

Currently the module only provides the ability to set values in a file. It would be nice if we could also read a value.

Get-EnvFileVariable -Variable "NODE_EXTRA_CA_CERTS" `
    -Path "$PSScriptRoot\src\rendering\.env.local"

Task runner or pipeline-style configuration of the development entrypoint

As a developer, I'd like to configure and customize startup activities in my development container, so that I can affect container content and behavior without impacting the delivered images.

Currently the development entrypoint includes the watch script, and soon development patch application. Rather than continue to build out this script monolithically, it would be good to have a central configuration file for the entrypoint, that allows specifying and configuring tasks.

Proposal from @pbering:

{
    "tasks": [
        { "powershell": {  "path": "C:\\tools\\transform.ps1", "args": "-Source 'C:\\sitecore-dev-patches\\Web.config.CustomErrorsOff.xdt' -Target 'C:\\inetpub\\wwwroot\\Web.config' " } },
        { "powershell": {  "path": "C:\\tools\\transform.ps1", "args": "-Source 'C:\\sitecore-dev-patches\\Web.config.InitMessagesOff.xdt' -Target 'C:\\inetpub\\wwwroot\\Web.config' " } },
        { "powershell": {  "path": "C:\\tools\\transform.ps1", "args": "-Source 'C:\\sitecore-dev-patches\\Web.config.OptimizeCompilationsOn.xdt' -Target 'C:\\inetpub\\wwwroot\\Web.config'" } },
        { "powershell": {  "path": "C:\\tools\\transform.ps1", "args": "-Source 'C:\\inetpub\\wwwroot\\Web.config.MyCustomDevStuff.xdt' -Target 'C:\\inetpub\\wwwroot\\Web.config'" } },
        { "powershell": {  "path": "C:\\tools\\sync.ps1", "args": "-Source 'C:\\src' -Target 'C:\\inetpub\\wwwroot' -Sleep '200'", "runAsJob": true  } },
        { "powershell": {  "path": "C:\\tools\\streamlogs.ps1", "args": "-IncludeIISLogs -IncludeSitecoreLogs -IncludeHttpSysLogs" } }
    ]
}

Or we could do something less verbose and more PowerShell-specific, similar to SIF:

{
    "tasks": [
        {
            "script": "Watch-Directory",
            "args": {

            }
        },
        {
            "script": "Development-Patches",
            "args": {
                "Include": [
                    "CustomErrorsOff",
                    "DebugOn",
                    "InitMessagesOff",
                    "DiagnosticsOff",
                    "RobotDetectionOff",
                    "OptimizeCompilationsOn",
                    "XdbOff"
                ]
            }
        }
    ]
}

Would it even be worth extracting the task runner pieces of SIF to do this? Or is there an existing PowerShell task runner we could use?

Toolset cannot be used on Linux

The module uses the Windows-specific function New-SelfSignedCertificate, plus some Windows delimiters in paths.
This makes it impossible to use on Linux ( e.g., on build agents).

Set environment variable values for more than just Docker Compose

As a developer, I'd like to use the Set-DockerComposeEnvFileVariable function for other dotenv files, like those used with Next.js, so that I can initialize values for developer environments.

Currently Set-DockerComposeEnvFileVariable only allows files named .env, and has a name that indicates it is only valuable for Docker Compose. Would like to use this function to initialize NODE_EXTRA_CA_CERTS for Next.js as well, e.g.

    Set-EnvFileVariable -Variable "NODE_EXTRA_CA_CERTS" `
         -Value "$(& $mkcert -CAROOT)\rootCA.pem" `
         -Path "$PSScriptRoot\src\rendering\.env.local"

If the function is renamed, the existing name should be retained as well as a pass-through for backward compatibility.

Investigate using watchexec as possible replacement for Watch-Directory tight loop running ROBOCOPY

Local tests of https://github.com/watchexec/watchexec shows promising results as a possible replacement of https://github.com/Sitecore/docker-tools/blob/main/image/src/scripts/Watch-Directory.ps1#L185. The current loop uses 2-3% CPU when idle where watchexec uses 0.

Other observations while testing watchexec:

  1. It uses less that 1 MB of memory.
  2. Watching an average Sitecore web application project / deploy folder it seems very good to batch events so it does not trigger too many times.
  3. Default ignoring glob patters defined in .gitignore and supports excluding/including files/folder from parameters.

We need to test this in a container to:

  1. See if it work at all since it is based on file events from the OS which can work behave differently in a container.
  2. Measure idle CPU usage / memory to see if there is actual benefits by switching.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.