<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dániel Gál</title>
    <description>The latest articles on DEV Community by Dániel Gál (@ddanielgal).</description>
    <link>https://dev.to/ddanielgal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F477610%2Fef578420-5c67-4662-8a5d-de06033786af.png</url>
      <title>DEV Community: Dániel Gál</title>
      <link>https://dev.to/ddanielgal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ddanielgal"/>
    <language>en</language>
    <item>
      <title>Developing a Node CLI App in an NX monorepo</title>
      <dc:creator>Dániel Gál</dc:creator>
      <pubDate>Sun, 10 Mar 2024 21:55:53 +0000</pubDate>
      <link>https://dev.to/ddanielgal/developing-a-node-cli-app-in-an-nx-monorepo-5f1a</link>
      <guid>https://dev.to/ddanielgal/developing-a-node-cli-app-in-an-nx-monorepo-5f1a</guid>
      <description>&lt;p&gt;Bare bones setup. Using NX version 17.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the app
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx nx g @nx/node:app &lt;span class="nt"&gt;--name&lt;/span&gt; cli &lt;span class="nt"&gt;--directory&lt;/span&gt; packages/cli &lt;span class="nt"&gt;--framework&lt;/span&gt; none &lt;span class="nt"&gt;--e2eTestRunner&lt;/span&gt; none &lt;span class="nt"&gt;--unitTestRunner&lt;/span&gt; none
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Commander
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-S&lt;/span&gt; commander @commander-js/extra-typings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure targets
&lt;/h2&gt;

&lt;p&gt;Modify the default build target's development configuration to include &lt;code&gt;"watch": true&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cli"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"../../node_modules/nx/schemas/project-schema.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sourceRoot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"packages/cli/src"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"projectType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"application"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"targets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"executor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@nx/esbuild:esbuild"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"outputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"{options.outputPath}"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"defaultConfiguration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"production"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"options"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"platform"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"outputPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/packages/cli"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cjs"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"bundle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"packages/cli/src/main.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"tsConfig"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"packages/cli/tsconfig.app.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"assets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"packages/cli/src/assets"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"generatePackageJson"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"esbuildOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"sourcemap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"outExtension"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;".js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;".js"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"configurations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"development"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"production"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"esbuildOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sourcemap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"outExtension"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;".js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;".js"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"lint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"executor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@nx/eslint:lint"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"outputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"{options.outputFile}"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Write a program
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// packages/cli/src/main.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;program&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@commander-js/extra-typings&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;program&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;things&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;one&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;two&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;three&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="nx"&gt;things&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;thing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thing&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;program&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start the development server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx nx run cli:build:development
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will watch for changes and recompile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the program
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node dist/packages/cli/main.js list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;one
two
three
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Grow your CLI App from here
&lt;/h2&gt;

&lt;p&gt;Visit the &lt;a href="https://www.npmjs.com/package/commander"&gt;Commander.js reference&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>node</category>
      <category>cli</category>
      <category>nx</category>
    </item>
    <item>
      <title>Quick and dirty Docker development environment for Node.js apps</title>
      <dc:creator>Dániel Gál</dc:creator>
      <pubDate>Mon, 19 Apr 2021 07:59:44 +0000</pubDate>
      <link>https://dev.to/ddanielgal/quick-and-dirty-docker-development-environment-for-node-js-apps-3da9</link>
      <guid>https://dev.to/ddanielgal/quick-and-dirty-docker-development-environment-for-node-js-apps-3da9</guid>
      <description>&lt;p&gt;&lt;a href="https://danielgaldev.medium.com/quick-and-dirty-docker-development-environment-for-node-js-apps-70fa1a130714" rel="noopener noreferrer"&gt;This article is also available on Medium.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/get-docker/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers" rel="noopener noreferrer"&gt;VSCode Remote - Containers extension&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Files
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;Start the environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Attach to the container in VSCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgm9rwb9y2s5jl79eecp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgm9rwb9y2s5jl79eecp0.png" alt="0_naxjaKYP9HGtOdD7"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru00vshzy4kf16n6v7xm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru00vshzy4kf16n6v7xm.png" alt="0_9azzNKlDwo0c_weB"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy! :)&lt;/p&gt;

&lt;p&gt;When done, stop the environment.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;I wrote an article on the benefits of using a Dockerized development environment. Check it out here:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://danielgaldev.medium.com/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F1%2At2ykeWrDwNEY8-URRFlfhQ.png" alt="Dániel Gál"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://danielgaldev.medium.com/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;9 reasons why you should use Docker as a development environment | by Dániel Gál | Medium&lt;/h2&gt;
      &lt;h3&gt;Dániel Gál ・ &lt;time&gt;Apr 19, 2021&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        danielgaldev.Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  What is this good for?
&lt;/h3&gt;

&lt;p&gt;A Node.js app can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an Express backend (eg. a REST API)&lt;/li&gt;
&lt;li&gt;any JavaScript frontend — React, Angular, Vue&lt;/li&gt;
&lt;li&gt;a CLI app written in JavaScript&lt;/li&gt;
&lt;li&gt;any other type of JavaScript app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is up to you what you make in this environment. I usually do React frontends.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tips
&lt;/h3&gt;

&lt;p&gt;When you are attached to the container in VSCode, the IDE's terminal opens a terminal session inside the container. Here you can execute commands directly inside your container without the need to attach to it from another external terminal like PowerShell.&lt;/p&gt;

&lt;p&gt;You can reduce the time spent starting and stopping the environment by shortening your Docker commands. If you have multiple concurrent projects, this will save you time and annoyance. I also wrote an article on how to do this, read it here:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://danielgaldev.medium.com/speed-up-your-docker-workflow-with-bash-functions-45f522bd87a4" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F1%2At2ykeWrDwNEY8-URRFlfhQ.png" alt="Dániel Gál"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://danielgaldev.medium.com/speed-up-your-docker-workflow-with-bash-functions-45f522bd87a4" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Speed up your Docker workflow with Bash functions | by Dániel Gál | Medium&lt;/h2&gt;
      &lt;h3&gt;Dániel Gál ・ &lt;time&gt;Nov 2, 2020&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        danielgaldev.Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;After you opened the dev container once, you can return to it from the "Open recent..." (Ctrl+R) command of VSCode. You don't have to always do the "Attach to running container…" command.&lt;/p&gt;

&lt;p&gt;You can extend this bare bones development environment with many different functionalities. I listed my suggestions here.&lt;/p&gt;

&lt;p&gt;If you would like to install packages in the container, the best way is to create a Dockerfile, define the install commands inside and change the &lt;code&gt;image&lt;/code&gt; property in the yml to &lt;code&gt;build&lt;/code&gt; with the correct reference to the build context. Here is an example for ffmpeg and the Vercel CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:14.5.0-alpine&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;apk add ffmpeg
&lt;span class="k"&gt;RUN &lt;/span&gt;npm i &lt;span class="nt"&gt;-g&lt;/span&gt; vercel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You could also install Git to get access to the version control tools inside VSCode while you are attached to the container. However, if you want to do version control efficiently inside the container, you will need to set up SSH and configure Git to be able to push your code. It is possible, but I am not a fan because it makes the setup more complex. I do version control on the host system in a separate VSCode window with the IDE's built-in Git tools and the Git Graph extension.&lt;/p&gt;

&lt;h3&gt;
  
  
  Explained, line-by-line
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;PROJECT_NAME=my-project&lt;/span&gt;
&lt;span class="s"&gt;PORT=3000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docker-compose can fetch the environment variables from a local &lt;code&gt;.env&lt;/code&gt; file. The purpose of this is to avoid repetition in the &lt;code&gt;docker-compose.yml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node:14.5.0-alpine&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I use the Alpine version of the Node image simply because it is small (40 MB compared to the &lt;code&gt;:latest&lt;/code&gt; 344 MB). I also use fixed versions to avoid the image upgrading itself and breaking something when I'm in a rush. This way I can upgrade the image when I have the time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;working_dir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/usr/src/${PROJECT_NAME}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use any working directory you want inside the container, I just use &lt;code&gt;/usr/src&lt;/code&gt; to avoid name collisions in the root of the filesystem. It also helps me differentiate the projects in VSCode's "Open recent..." menu — back when I used &lt;code&gt;/app&lt;/code&gt; or &lt;code&gt;/code&lt;/code&gt; everywhere, I didn't know which project's folder I'm about to open.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;env_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.env&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The environment variables defined in &lt;code&gt;.env&lt;/code&gt; will be available inside the container. This is where I put my config options, passwords and secret keys for the app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;${PORT}:${PORT}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a high chance I'm building a web app or a REST API, so I map a port of the container to the same port of the host system to be able to access my app or service in the browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/usr/src/${PROJECT_NAME}/node_modules&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.:/usr/src/${PROJECT_NAME}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am mapping the project directory to the container's working directory so that the edits I make in the container propagate to the host system where I do my version control. I don't want the content of &lt;code&gt;node_modules&lt;/code&gt; leaking into my host system however, so I defined that folder as a volume on its own. Otherwise the npm installs would be noticeably slower because the files need to be copied from the container to the host.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;entrypoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tail -F /dev/null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I would start the container without this entrypoint, it would just exit and I would not be able to attach to it. This command makes the container run indefinitely.&lt;/p&gt;

&lt;p&gt;For more advanced devcontainer options visit VSCode's &lt;a href="https://code.visualstudio.com/docs/remote/containers" rel="noopener noreferrer"&gt;Developing inside a Container&lt;/a&gt; article.&lt;/p&gt;

&lt;p&gt;Thank you for reading to the end and have a wonderful day :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cover photo by &lt;a href="https://unsplash.com/@jefflssantos?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Jefferson Santos&lt;/a&gt; on &lt;a href="https://unsplash.com/?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>docker</category>
      <category>node</category>
      <category>programming</category>
    </item>
    <item>
      <title>Speed up your Docker workflow with Bash functions</title>
      <dc:creator>Dániel Gál</dc:creator>
      <pubDate>Mon, 02 Nov 2020 20:24:42 +0000</pubDate>
      <link>https://dev.to/danielgaldev/speed-up-your-docker-workflow-with-bash-functions-49c8</link>
      <guid>https://dev.to/danielgaldev/speed-up-your-docker-workflow-with-bash-functions-49c8</guid>
      <description>&lt;p&gt;&lt;a href="https://danielgaldev.medium.com/speed-up-your-docker-workflow-with-bash-functions-45f522bd87a4"&gt;This article is also available on Medium.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;I am a web developer and I use docker-compose in all of my projects. Sometimes it is just one container for the frontend part of the app, sometimes it is the whole stack: client, api, database, proxy server.&lt;/p&gt;

&lt;p&gt;I recently started &lt;a href="https://docs.docker.com/docker-for-windows/wsl/"&gt;using WSL2 as the backend of the Docker for Windows service&lt;/a&gt;, and for performance reasons I keep my projects on the Ubuntu VM. This means that I do the command line work in Ubuntu's terminal, which uses Bash.&lt;/p&gt;

&lt;p&gt;If you are curious as to why I am using Docker everywhere, check out my article about the pros of using it as a development environment.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OnTlAy3D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2At2ykeWrDwNEY8-URRFlfhQ.png" alt="Dániel Gál"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;9 reasons why you should use Docker as a development environment | by Dániel Gál | Oct, 2020 | Medium&lt;/h2&gt;
      &lt;h3&gt;Dániel Gál ・ &lt;time&gt;Oct 9, 2020&lt;/time&gt; ・ 5 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  The problem
&lt;/h1&gt;

&lt;p&gt;Given the circumstances, I have to type many long commands to start up, manage and stop my stack. I would guess that I use some form of &lt;code&gt;docker-compose&lt;/code&gt; at least 50 times a day, with the length of the command being 20-60 characters depending on the project. The history feature of Bash is not perfect either, pressing the up and down arrows until you find the command you are looking for requires more attention than you might expect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1vb9SePS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/735911/pexels-photo-735911.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1vb9SePS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/735911/pexels-photo-735911.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" alt="https://images.pexels.com/photos/735911/pexels-photo-735911.jpeg?auto=compress&amp;amp;cs=tinysrgb&amp;amp;dpr=2&amp;amp;h=650&amp;amp;w=940"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo &lt;a href="https://www.pexels.com/@soumil-kumar-4325"&gt;Soumil Kumar&lt;/a&gt; by on &lt;a href="https://www.pexels.com/"&gt;Pexels&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The goal
&lt;/h1&gt;

&lt;p&gt;I would like to substitute most of the commands I use by 2 or 3 character long mini-commands. I should choose short commands that you are not likely to use. I chose &lt;code&gt;du&lt;/code&gt;, &lt;code&gt;dud&lt;/code&gt;, &lt;code&gt;ds&lt;/code&gt;, &lt;code&gt;dd&lt;/code&gt;, &lt;code&gt;da&lt;/code&gt;, &lt;code&gt;dss&lt;/code&gt; and &lt;code&gt;dus&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note that I'm not going to define a shortcut to every Docker command, as that would be pointless. My goal is that I can use a mini-command at least 8 out of 10 times.&lt;/p&gt;

&lt;p&gt;But there is a catch. There are some projects, where we have two different compose files: one for development and one for production. In this case, I would like to use the dev compose file.&lt;br&gt;
This requires a &lt;code&gt;-f docker-compose.dev.yml&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;The commands I will define bash functions for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docker-compose up&lt;/code&gt; — starting the containers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker-compose up -d&lt;/code&gt; — starting the containers in detached mode&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker-compose stop&lt;/code&gt; — stopping the containers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker-compose exec &amp;lt;servicename&amp;gt; &amp;lt;command&amp;gt;&lt;/code&gt; — attaching to a running service with a shell of our choice&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker-compose up &amp;lt;servicename&amp;gt; -d&lt;/code&gt; — starting a specific service in detached mode&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docker-compose stop &amp;lt;servicename&amp;gt;&lt;/code&gt; — stopping a specific service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see some of these functions will have parameters, which will have default values.&lt;/p&gt;
&lt;h1&gt;
  
  
  The solution
&lt;/h1&gt;

&lt;p&gt;I am going to define my functions in the home directory, in a file named &lt;code&gt;.bash_functions&lt;/code&gt;. This file should be sourced at the beginning of the terminal session, so I extend my &lt;code&gt;.bashrc&lt;/code&gt; file with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; ~/.bash_functions &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;.&lt;/span&gt; ~/.bash_functions
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now onto the &lt;code&gt;.bash_functions&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;I start with the first part of the command. We need to determine if we need the &lt;code&gt;-f&lt;/code&gt; option or not.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;function &lt;/span&gt;set-compose-command &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;COMPOSE_COMMAND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"docker-compose"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; docker-compose.dev.yml &lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;then 
        &lt;/span&gt;&lt;span class="nv"&gt;COMPOSE_COMMAND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"docker-compose -f docker-compose.dev.yml"&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I will not call this function manually, however it will be executed at the beginning of every other function. It will set the &lt;code&gt;COMPOSE_COMMAND&lt;/code&gt; variable in our current shell instance so the other functions just need to attach their specific task at the end. The logic is simple: if the &lt;code&gt;docker-compose.dev.yml&lt;/code&gt; file exists, apply the &lt;code&gt;-f&lt;/code&gt; option with the filename.&lt;/p&gt;

&lt;p&gt;Next, I define 4 shortcuts that do not require parameters.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;function &lt;/span&gt;dud &lt;span class="o"&gt;{&lt;/span&gt;
    set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; up -d"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function &lt;/span&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; up"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function &lt;/span&gt;&lt;span class="nb"&gt;dd&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; down"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function &lt;/span&gt;ds &lt;span class="o"&gt;{&lt;/span&gt;
    set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; stop"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The next two functions require one argument each. Without an argument, they will fail.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Stop service&lt;/span&gt;
&lt;span class="k"&gt;function &lt;/span&gt;dss &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please specify a service."&lt;/span&gt;
        &lt;span class="k"&gt;return &lt;/span&gt;1
    &lt;span class="k"&gt;fi
    &lt;/span&gt;set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; stop &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Start service&lt;/span&gt;
&lt;span class="k"&gt;function &lt;/span&gt;dus &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please specify a service."&lt;/span&gt;
        &lt;span class="k"&gt;return &lt;/span&gt;1
    &lt;span class="k"&gt;fi
    &lt;/span&gt;set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; up -d &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The functions check if the user supplied at least one argument, and exit with a failing status if not.&lt;/p&gt;

&lt;p&gt;The last function has two parameters, both of which have default values.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;function &lt;/span&gt;da &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;dev&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
    &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;sh&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
    set-compose-command
    sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMPOSE_COMMAND&lt;/span&gt;&lt;span class="s2"&gt; exec &lt;/span&gt;&lt;span class="nv"&gt;$service&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$shell&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The reason for the default values is that I attach to a &lt;code&gt;sh&lt;/code&gt; shell in the container 90% of the time (I mostly use alpine images and they don't have &lt;code&gt;bash&lt;/code&gt;), and if I only have one service in my compose file, I will most likely name it &lt;code&gt;dev&lt;/code&gt;, hence the default service name.&lt;/p&gt;
&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;My docker-compose workflow is now faster and also more comfortable. No more typing the same long commands over and over again.&lt;/p&gt;

&lt;p&gt;This is me starting up an environment, making some changes inside and then stopping it when I'm finished:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;den@workstation:~/work/myproject&lt;span class="nv"&gt;$ &lt;/span&gt;dud
Starting myproject_myservice_1 ... &lt;span class="k"&gt;done
&lt;/span&gt;den@workstation:~/work/myproject&lt;span class="nv"&gt;$ &lt;/span&gt;da myservice
/usr/src/myproject &lt;span class="c"&gt;# touch somefile.txt&lt;/span&gt;
/usr/src/myproject &lt;span class="c"&gt;# ^D&lt;/span&gt;
den@workstation:~/work/myproject&lt;span class="nv"&gt;$ &lt;/span&gt;ds
Stopping myproject_myservice_1 ... &lt;span class="k"&gt;done
&lt;/span&gt;den@workstation:~/work/myproject&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c8D7UZsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/5483064/pexels-photo-5483064.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c8D7UZsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/5483064/pexels-photo-5483064.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" alt="https://images.pexels.com/photos/5483064/pexels-photo-5483064.jpeg?auto=compress&amp;amp;cs=tinysrgb&amp;amp;dpr=2&amp;amp;h=650&amp;amp;w=940"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://www.pexels.com/@cottonbro"&gt;cottonbro&lt;/a&gt; on &lt;a href="https://www.pexels.com/"&gt;Pexels&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep in mind that you might not need the exact functions I did, or you might need more. It would be best if you paid some attention to which commands you use most often in your workflow, and define functions for those.&lt;/p&gt;

&lt;p&gt;You also don't have to be a bash expert or even an intermediate level script developer to write your custom functionalities. There are plenty of resources to help you, as long as you are not new to programming and know what to search for.&lt;/p&gt;

&lt;p&gt;I hope you have a nice day. Work smarter, not harder.&lt;/p&gt;



&lt;p&gt;If you're curious about Docker and want to try it out in development or in production, check out these articles to get started:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oKh4_7z8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/1%2AlHIefjTQECM96G6Ef8xn6g.jpeg" alt="Preethi Kasireddy"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;A Beginner-Friendly Introduction to Containers, VMs and Docker | by Preethi Kasireddy | freeCodeCamp.org | Medium&lt;/h2&gt;
      &lt;h3&gt;Preethi Kasireddy ・ &lt;time&gt;Oct 29, 2019&lt;/time&gt; ・ 13 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;




&lt;div class="ltag__link"&gt;
  &lt;a href="https://towardsdatascience.com/learn-enough-docker-to-be-useful-b7ba70caeb4b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y56rRGur--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2AAsb9N4lW4pQN_Id2qwtPOA.jpeg" alt="Jeff Hale"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://towardsdatascience.com/learn-enough-docker-to-be-useful-b7ba70caeb4b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Learn Enough Docker to be Useful. Part 1: The Conceptual Landscape | by Jeff Hale | Towards Data Science&lt;/h2&gt;
      &lt;h3&gt;Jeff Hale ・ &lt;time&gt;Dec 13, 2019&lt;/time&gt; ・ 7 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        towardsdatascience.com
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>docker</category>
      <category>bash</category>
      <category>linux</category>
      <category>webdev</category>
    </item>
    <item>
      <title>9 reasons why you should use Docker as a development environment</title>
      <dc:creator>Dániel Gál</dc:creator>
      <pubDate>Fri, 09 Oct 2020 20:47:50 +0000</pubDate>
      <link>https://dev.to/danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-474j</link>
      <guid>https://dev.to/danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-474j</guid>
      <description>&lt;p&gt;I have been developing React apps in &lt;a href="https://www.docker.com/"&gt;Docker&lt;/a&gt; for a few years now, and so far nothing was able to stop me from containerizing every project I get started with.&lt;/p&gt;

&lt;p&gt;This article is perfect for you if you read about containers or already started playing around with them, but you are not yet sold on the idea of using them as a development environment. If you have no idea what a container is, check out the links at the bottom.&lt;/p&gt;

&lt;p&gt;This is more of a "meta" writing about container based development, not a guide on getting started with it. If you are looking for some tutorials, hit up the search bar above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QdOdQG5g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1593824854968-7833add41c16%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1050%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QdOdQG5g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1593824854968-7833add41c16%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1050%26q%3D80" alt="https://images.unsplash.com/photo-1593824854968-7833add41c16?ixlib=rb-1.2.1&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=1050&amp;amp;q=80"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@brodanoel"&gt;Noel Broda&lt;/a&gt; on &lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  No clutter on your PC
&lt;/h3&gt;

&lt;p&gt;Know the feeling of working on multiple projects and having 4 versions of Node, 2 versions of Python and 3 separate database management software installed on your machine? Do you have the habit of starting a new project every few months to try out a new trending technology, but during the struggle of setting it up and getting a "Hello World" app to work you lose your motivation?&lt;/p&gt;

&lt;p&gt;With Docker, all the software required to run your app is inside the container. This gets us to the next reason:&lt;/p&gt;

&lt;h3&gt;
  
  
  No other software needed
&lt;/h3&gt;

&lt;p&gt;At least not on the host computer (your machine). Given a fresh install of Windows, macOS or Linux, once you install Docker, you can just clone the project repository and fire up your app. If you set the environment up right, it should work out of the box.&lt;/p&gt;

&lt;h3&gt;
  
  
  Isolated environment
&lt;/h3&gt;

&lt;p&gt;What happens in the container, stays in the container. You can install all the dependencies you want, it will not affect your host machine. The opposite applies too, the other software installed on your computer will not interfere with your app in the container.&lt;/p&gt;

&lt;h3&gt;
  
  
  Works anywhere
&lt;/h3&gt;

&lt;p&gt;If a computer has Docker installed, you can develop your app on it without effort. If you want your friend or colleague involved in creating your app, they don't have to spend hours installing software and dependencies. The just need to give one universal command and they are ready to go. If you don't like taking your computer to and from the office you work at, you can have the same environment on both machines with Docker. You can even set it up on a server and attach to it remotely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bxBR5zu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1528660493888-ab6f4761e036%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D334%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bxBR5zu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1528660493888-ab6f4761e036%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D334%26q%3D80" alt="https://images.unsplash.com/photo-1528660493888-ab6f4761e036?ixlib=rb-1.2.1&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=334&amp;amp;q=80"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@steve3p_0"&gt;Steve Halama&lt;/a&gt; on &lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy cleanup
&lt;/h3&gt;

&lt;p&gt;Once you are done with a project, just delete the image and any containers you created, and you're good. It doesn't take up space on your machine anymore. If you change your mind, you can build it again with one single command. Without Docker, you would have to remember all the software you installed just to get a project running, and get rid of them individually to free your computer from the stuff you don't use anymore.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy on disk space
&lt;/h3&gt;

&lt;p&gt;Not everybody has terabytes of SSD storage these days. Maybe you only own a 256 GB drive, like me. Working on multiple projects, having 5 different IDEs and many libraries installed takes its toll on your storage space. With Docker, if you put a project on hold, you can just delete its images and containers from your computer. You can easily build it again if you want to continue and you will get the same environment.&lt;/p&gt;

&lt;p&gt;It is also possible to persist files across builds with the help of volumes, so you don't have to delete and recreate some parts of your app every time, for example a database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gateway to production
&lt;/h3&gt;

&lt;p&gt;The skills learned trying to configure a Docker environment for the development process might come in handy when you're shipping your app. Chances are you will deploy it on some kind of cloud infrastructure that supports containers like &lt;a href="https://kubernetes.io/"&gt;Kubernetes&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  CI/CD
&lt;/h3&gt;

&lt;p&gt;Some CI/CD providers (like &lt;a href="https://circleci.com/"&gt;CircleCI&lt;/a&gt;) offer the possibility of using containers in your builds. Since your environment is already a container, little to no configuration is needed to make your app test and deploy itself automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y-T3qOzC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1556075798-4825dfaaf498%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1055%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y-T3qOzC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1556075798-4825dfaaf498%3Fixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1055%26q%3D80" alt="https://images.unsplash.com/photo-1556075798-4825dfaaf498?ixlib=rb-1.2.1&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=1055&amp;amp;q=80"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@yancymin"&gt;Yancy Min&lt;/a&gt; on &lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  VSCode Remote - Containers
&lt;/h3&gt;

&lt;p&gt;This VSCode extension is so great, it deserves its own section. To be honest, it is the main reason why I wanted to share this knowledge with you.&lt;/p&gt;

&lt;p&gt;Before this extension existed, if we wanted to edit the code in the container without restarting it every time we made a change, we had to mount the project folder as a volume. If you changed the file on the host computer, it changed in the container as well. This had (still has) some problems.&lt;/p&gt;

&lt;p&gt;Technology reliant on filesystem events like live reloading were a pain to work with. They were not as reliable because the filesystem events did not happen in the container (a shortcoming of mounted volumes), and on many occasions polling was required, draining your computer's processing power just to watch file changes.&lt;/p&gt;

&lt;p&gt;With VSCode Remote - Containers, these problems don't exist. You can attach VSCode to the container itself, open the project folder inside it and get to work. The file changes now happen inside the container, no need for polling or mounting the code as a volume.&lt;/p&gt;

&lt;p&gt;Mounting the code is still a good idea though, if you want to use version control software on the host computer (a Git client like &lt;a href="https://www.gitkraken.com/"&gt;GitKraken&lt;/a&gt; for example).&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://code.visualstudio.com/docs/remote/containers"&gt;VSCode docs&lt;/a&gt; on developing inside a container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The community behind Docker based development environments is strong. The most popular languages, runtimes and frameworks like Node, Python and Ruby have a plethora of guides to help you Dockerize your development experience. If the reasons listed in this article made you curious about this way of creating software, make sure to try it out!&lt;/p&gt;

&lt;p&gt;If you decide to go with Docker for your next project, check out these tips to improve your productivity:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://danielgaldev.medium.com/speed-up-your-docker-workflow-with-bash-functions-45f522bd87a4" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OnTlAy3D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2At2ykeWrDwNEY8-URRFlfhQ.png" alt="Dániel Gál"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://danielgaldev.medium.com/speed-up-your-docker-workflow-with-bash-functions-45f522bd87a4" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Speed up your Docker workflow with Bash functions | by Dániel Gál | Medium&lt;/h2&gt;
      &lt;h3&gt;Dániel Gál ・ &lt;time&gt;Nov 2, 2020&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ze5yh_2q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        danielgaldev.Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Other useful resources
&lt;/h2&gt;

&lt;p&gt;Check out these writings on Docker and containers in general:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oKh4_7z8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/96/96/1%2AlHIefjTQECM96G6Ef8xn6g.jpeg" alt="Preethi Kasireddy"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;A Beginner-Friendly Introduction to Containers, VMs and Docker | by Preethi Kasireddy | freeCodeCamp.org | Medium&lt;/h2&gt;
      &lt;h3&gt;Preethi Kasireddy ・ &lt;time&gt;Oct 29, 2019&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ze5yh_2q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="https://towardsdatascience.com/learn-enough-docker-to-be-useful-b7ba70caeb4b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y56rRGur--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2AAsb9N4lW4pQN_Id2qwtPOA.jpeg" alt="Jeff Hale"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://towardsdatascience.com/learn-enough-docker-to-be-useful-b7ba70caeb4b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Learn Enough Docker to be Useful. Part 1: The Conceptual Landscape | by Jeff Hale | Towards Data Science&lt;/h2&gt;
      &lt;h3&gt;Jeff Hale ・ &lt;time&gt;Dec 13, 2019&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ze5yh_2q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        towardsdatascience.com
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;This article is also available on Medium.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OnTlAy3D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2At2ykeWrDwNEY8-URRFlfhQ.png" alt="Dániel Gál"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@danielgaldev/9-reasons-why-you-should-use-docker-as-a-development-environment-96e2ce154194" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;9 reasons why you should use Docker as a development environment | by Dániel Gál | Medium&lt;/h2&gt;
      &lt;h3&gt;Dániel Gál ・ &lt;time&gt;Apr 19, 2021&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ze5yh_2q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>docker</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
