Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Add README with instructions for local build
Browse files Browse the repository at this point in the history
  • Loading branch information
agarciadom committed Dec 2, 2024
1 parent bd48021 commit 1ce5175
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,47 @@ docker run -p 8000:80 eclipseepsilon/playground:latest

## Build and Run the Docker Image

If you prefer to build the image from source instead of fetching it from Docker Hub, clone the repository and use this command to build the image:
### Setting up token-based access to the playground-micronaut packages

If you prefer to build the image from source instead of fetching it, first ensure that your `$HOME/.m2/settings.xml` has a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) that can read public repositories associated to the `github-playground-micronaut` server.

The `settings.xml` file could look like this:

```xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github-playground-micronaut</id>
<username>YOUR_GITHUB_USERNAME</username>
<password>YOUR_GITHUB_TOKEN</password>
</server>
</servers>
</settings>
```

### Building the image

You can now clone the repository and use this command to build the image:

```shell
docker image build -t playground:latest .
./docker-build.sh
```

and this command to run the image in a container:
### Running the image

Use this command to run the image in a container:

```shell
docker run -p 8000:80 playground:latest
docker run -p 8000:80 playground:micronaut
```

Should you need to customise the port that `nginx` runs on, you can do so through the `PORT` environment variable (as required by Google Cloud Build):

```shell
docker run --env PORT=8020 -p 8000:8020 playground:latest
docker run --env PORT=8020 -p 8000:8020 playground:micronaut
```

## Access the Epsilon Playground
Expand All @@ -53,6 +78,8 @@ docker run -p 8000:80 -v <front-end-folder-absolute-path>:/etc/nginx/html playgr
```
Your front-end folder should contain an `index.html` file. A minimal alternative front-end that you can use as a starting point for developing your custom front-end is available in the `miniground` folder of [this repository](miniground).

Alternatively, you may want to use the [Docker image for the Micronaut-based backend](https://github.com/epsilonlabs/playground-micronaut/pkgs/container/playground-micronaut) directly, without using this image.

## Publish to Docker Hub

Run the following command to build a `linux/amd64` image (replace `x.y.z` with the actual version you wish to release)
Expand Down
4 changes: 4 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

mvn dependency:copy-dependencies -DexcludeTransitive=true
docker build -t playground-docker:micronaut .

0 comments on commit 1ce5175

Please sign in to comment.