Re: Build and run Docker container locally with Shopify CLI Ruby+React App

Build and run Docker container locally with Shopify CLI Ruby+React App

shreyass
Shopify Partner
8 1 2

 

Hi,

 

How do we build and run a container locally with default Dockerfile that Shopify CLI provides for Ruby+React Apps?

 

I'm building a Shopify CLI App with Ruby+React. I tried running a container with the default Dockerfile locally, but it does not render React (I think as vite server doesn't start).

 

We deploy manually to Ubuntu VM with just Docker containers (I know, I know). Hence, it is very important for us to run the same container locally as well as on the server. I understand `npm run dev` will run both, but this doesn't help with deployment on Ubuntu VM.

 

Any help or lead would be grately appreciated.

Reply 1 (1)

b2tech
Shopify Partner
18 4 2

Hi Shreyass,

 

This article helped me get a Shopify CLI App running locally with Docker.

https://dev.to/nickbahson/dockerizing-your-shopify-app-5ef4

 

From my understanding instead of using npm run dev, use docker run. But without 'npm run dev' the tunneling and app url updating has to be done manually. Once the app is able to run with docker locally, it should just need host or any config updated to run on another environment.