Skip to content

Commit

Permalink
chore(jsp): wip docs and updated dockerfile (#531)
Browse files Browse the repository at this point in the history
- some docs on the new GCP run environment
- update the Dockerfile to be less vulnerable
- also ignore 'cldr' which is a location used by the automated build

For #523
  • Loading branch information
srl295 authored Aug 23, 2023
1 parent 5c75c44 commit 51e7890
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ rules.mk

.DS_Store
/output
/cldr
2 changes: 1 addition & 1 deletion UnicodeJsps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN ls -lh /build/source/bidiref1 && (/build/source/bidiref1 || true)
ADD ./target/cldr-unicodetools.tgz /build/data/
# move this into place (including unicodetools/unicodetools)
RUN rm -rf /build/data/cldr/.git # unneeded
FROM jetty:9-jre11-slim AS run
FROM jetty:9-jre11-alpine-eclipse-temurin AS run
ADD port-entrypoint.sh /port-entrypoint.sh
ADD ./jetty.d/ROOT /var/lib/jetty/webapps/ROOT/
ENTRYPOINT [ "/port-entrypoint.sh" ]
Expand Down
64 changes: 64 additions & 0 deletions docs/unicodejsps/gcp-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Manually Building and Pushing UnicodeJSPs to Docker / GCP Run

- This page is Under Construction by Steven `@srl295`

- see [index.md](./index.md) for the prior documentation

## maven stuff

- local build

```
mvn -B package -am -pl UnicodeJsps -DskipTests=true
```

- make a copy of CLDR - lots of ways to do this

```
git clone --reference-if-able ~/src/cldr https://github.com/unicode-org/cldr.git
mkdir -p UnicodeJsps/target && tar -cpz --exclude=.git -f UnicodeJsps/target/cldr-unicodetools.tgz ./cldr/ ./unicodetools/
```

## docker stuff

- build it

```
docker build -t unicode/unicode-jsps .
```

- try it

```
docker run --rm -p 8080:8080 unicode/unicode-jsps
```

=> <http://127.0.0.1:8080>


## cloudy stuff

- install gcloud sdk

- `gcloud init`

- login to docker

```
gcloud auth configure-docker \
us-central1-docker.pkg.dev
```

- build docker image

```
docker build -t us-central1-docker.pkg.dev/goog-unicode-dev/unicode-jsps/unicode-jsps:latest .
```

- push docker image

_(takes a while - ~4G to push)_

```
docker push us-central1-docker.pkg.dev/goog-unicode-dev/unicode-jsps/unicode-jsps:latest
```
8 changes: 8 additions & 0 deletions docs/unicodejsps/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Building UnicodeJsp

- Note: you can run the latest UnicodeJsp locally with docker using:

```
docker run --rm -p 8080:8080 unicode/unicode-jsp
```

- Note 2: there are some notes on updated processes for using GCP at [gcp-run.md](./gcp-run.md) - at present, automated deployment is TODO.

## Compiling
### Prerequisites
- Java
Expand Down

0 comments on commit 51e7890

Please sign in to comment.