From afb083878bd4811f63603d40b589c50d2e850ef8 Mon Sep 17 00:00:00 2001 From: Antonio Garcia-Dominguez Date: Mon, 2 Dec 2024 19:17:19 +0000 Subject: [PATCH] Add README with instructions for local build --- README.md | 37 ++++++++++++++++++++++++++++++++----- docker-build.sh | 4 ++++ 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100755 docker-build.sh diff --git a/README.md b/README.md index 989f767..bb16526 100644 --- a/README.md +++ b/README.md @@ -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 + + + + github-playground-micronaut + YOUR_GITHUB_USERNAME + YOUR_GITHUB_TOKEN + + + +``` + +### 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 @@ -53,6 +78,8 @@ docker run -p 8000:80 -v :/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) diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 0000000..ca10ece --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +mvn dependency:copy-dependencies -DexcludeTransitive=true +docker build -t playground-docker:micronaut . \ No newline at end of file