<h1>Preliminary Info</h1>
<p>I have a docker-compose file that describes two services, one built from a dockerhub mysql image and the other built from a dockerhub node alpine image. The <code>docker-compose.yml</code> is as follows:</p>
<pre><code>version: &quot;3.8&quot;
services:
  client:
      image: node:alpine
      command: sh -c &quot;cd server &amp;&amp; yarn install &amp;&amp; cd .. &amp;&amp; yarn install &amp;&amp; yarn start&quot;
      ports:
        - &quot;3000:3000&quot;
      working_dir: /portal
      volumes: 
        - ./:/portal
      environment:
        MYSQL_HOST: mysql
        MYSQL_USER: root
        MYSQL_PASSWORD: password
        MYSQL_DB: files
  mysql:
      image: mysql:5.7
      volumes:
          - yaml-mysql-data:/var/lib/mysql
      environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: files
    
volumes:
  yaml-mysql-data:

</code></pre>
<h1>Current Understanding</h1>
<p><strong>I'm trying to deploy my app using kubernetes</strong>, but a kubernetes .yml file requires that I provide a path to my container images on dockerhub. However, I don't have them on dockerhub. I'm not sure how to push my images as they are built from the mysql and node images that I pull.</p>
<p>I know that <code>docker-compose push</code> can be used, however it's for locally built images; whereas I'm pulling images from dockerhub and am providing specific instructions in my <code>docker-compose.yml</code> when spinning them up.</p>
<h1>Question</h1>
<p>How can I push these images including the commands that should be run; e.g. <code>command: sh -c &quot;cd server &amp;&amp; yarn install &amp;&amp; cd .. &amp;&amp; yarn install &amp;&amp; yarn start&quot;</code>? (which is on line 5 of <code>docker-compose.yml</code> above)</p>
<p>Thanks</p>

Parm
<p>The logic that you put in the docker-compose.yml actually belongs with a Dockerfile. So create a Dockerfile for your nodejs applications (there are plenty of examples for this).</p>
<p>Then in your docker-compose.yml you build your own image that you can then push to a registry.</p>
<pre><code>version: &quot;3.8&quot;
services:
  client:
      image: your_registry/your_name:some_tag
      build: .
      ports: ...
      environment: ....
</code></pre>
