Home Explore Blog CI



docker

3rd chunk of `content/manuals/harmonia/_index.md`
eb815db33f3e7337a8ed1cc91d514f2ae4565fa92b9839ff0000000100000926
7. Run the project in the cloud engine with:
   ```console
   $ docker compose up -d
   ```
8. Test the application by visiting [`http://localhost:3000`](http://localhost:3000/).
   You should see the home page. The code for this page is located in `react-express-mysql/frontend/src/App.js`.
9. In an IDE or text editor, open the `App.js` file, change some text, and save. Watch as the code reloads live in your browser.

{{< /tab >}}
{{< tab name="CLI">}}

1. Clone the [Awesome Compose](https://github.com/docker/awesome-compose) repository.
2. In your terminal, change into the `awesome-compose/react-express-mysql` directory.
3. Create a file sync for `cloudengine`:
   ```console
   $ docker harmonia file-sync create --engine cloudengine $PWD
4. Run the project in the cloud engine with:
   ```console
   $ docker compose up -d
   ```
5. Test the application by visiting [`http://localhost:3000`](http://localhost:3000/).
   You should see the home page. The code for this page is located in `react-express-mysql/frontend/src/App.js`.
6. In an IDE or text editor, open the `App.js` file, change some text, and save. Watch as the code reloads live in your browser.

{{< /tab >}}
{{< /tabs >}}

### Step five: Share a container port

{{< tabs group="method" >}}
{{< tab name="Docker Desktop">}}

1.  Make sure your Docker context is set to `cloudengine`.
2.  In the Docker Desktop Dashboard, navigate to the **Containers** view.
3.  If necessary, expand the application listing to show all of its containers.
4.  Select the **lock** icon in the **Ports** column of your running container next to `3000:3000`.
    This creates a publicly accessible URL that you can share with teammates.
5.  Select the **copy** icon, to copy this URL.

To view all shared ports for your Docker context, select the **Shared ports** icon in the bottom-right corner of the Docker Desktop Dashboard.

{{< /tab >}}
{{< tab name="CLI">}}

To share a container port, make sure your Docker context is set to `cloudengine` and then run: 
``` console
$ docker harmonia engine share create cloudengine 3000
```
This returns a publicly accessible URL for your React app hosted on port `3000`, that you can share with teammates.

To see a list of all your shared ports, run:

```console
$ docker harmonia engine share list 
```

{{< /tab >}}
{{< /tabs >}}

Title: Sharing Container Ports with Project Harmonia
Summary
This section details how to share a container port, specifically port 3000, using both the Docker Desktop Dashboard and the command line interface (CLI). By sharing a port, a publicly accessible URL is created, enabling users to share their application with teammates. Instructions are provided for viewing all shared ports for the current Docker context.