Skip to content

Commit

Permalink
HTM-1173: Rename docker images to use the new Tailormap organisation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins authored Aug 19, 2024
1 parent 007f4d6 commit ad46536
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projectName": "tailormap-viewer",
"projectOwner": "B3Partners",
"projectOwner": "Tailormap",
"imageSize": 100,
"repoType": "github",
"commit": true,
Expand Down
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COMPOSE_PROJECT_NAME=tailormap
# If you want to build a custom Tailormap image with additional Angular libraries with extra components (see the
# tailormap-starter and tailormap-hello-world repositories), change the image name below.
# It's strongly recommended to specify a specific VERSION when building a customized Tailormap.
TAILORMAP_IMAGE=ghcr.io/b3partners/tailormap
TAILORMAP_IMAGE=ghcr.io/tailormap/tailormap
# Space-separated list of Angular libraries to add to a customized Tailormap.
ADD_NG_LIBRARIES=@tailormap-b3p/hello-world
# Text to append to .npmrc, for example to point a scope to a your own (public) repository instead of npmjs.com
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/cleanup-and-maintainance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# uses: 'vlaurin/[email protected]'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# organization: Tailormap
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 7
Expand All @@ -29,7 +29,7 @@ jobs:
# uses: 'vlaurin/[email protected]'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# organization: Tailormap
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 28
Expand All @@ -40,7 +40,7 @@ jobs:
# uses: 'vlaurin/[email protected]'
# with:
# token: ${{ secrets.GHCR_CLEANUP_PAT }}
# organization: B3Partners
# organization: Tailormap
# container: ${{ matrix.containers }}
# dry-run: false
# keep-younger-than: 28
Expand Down Expand Up @@ -68,6 +68,5 @@ jobs:
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
# same as "Artifact and log retention" in https://github.com/B3Partners/tailormap-viewer/settings/actions
retain_days: 90
keep_minimum_runs: 2
2 changes: 1 addition & 1 deletion .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
run: |
docker buildx create --use --name tailormap-builder
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx build --progress plain --pull --build-arg VERSION=${VERSION} --build-arg API_VERSION=snapshot --build-arg BASE_HREF=${BASE_HREF} --platform linux/amd64,linux/arm64 -t ghcr.io/b3partners/tailormap:${VERSION} . --push
docker buildx build --progress plain --pull --build-arg VERSION=${VERSION} --build-arg API_VERSION=snapshot --build-arg BASE_HREF=${BASE_HREF} --platform linux/amd64,linux/arm64 -t ghcr.io/tailormap/tailormap:${VERSION} . --push
- name: 'Set Docker context for deployment'
uses: arwynfr/actions-docker-context@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:

- name: Build images
run: |
docker buildx build --pull --build-arg VERSION=snapshot --build-arg BASE_HREF=/ -t ghcr.io/b3partners/tailormap:snapshot . --load
docker buildx build --pull --build-arg VERSION=snapshot --build-arg BASE_HREF=/ -t ghcr.io/tailormap/tailormap:snapshot . --load
- name: Run Trivy vulnerability scanner on tailormap-viewer
uses: 'aquasecurity/[email protected]'
# docker run --rm -v trivy_cache:/root/.cache/ aquasec/trivy image ghcr.io/b3partners/tailormap:snapshot
# docker run --rm -v trivy_cache:/root/.cache/ aquasec/trivy image ghcr.io/tailormap/tailormap:snapshot
with:
image-ref: 'ghcr.io/b3partners/tailormap:snapshot'
image-ref: 'ghcr.io/tailormap/tailormap:snapshot'
format: 'sarif'
output: 'tailormap-trivy-results.sarif'
severity: 'HIGH,CRITICAL'
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ COPY . /app

RUN npm run build-localized -- --base-href=${BASE_HREF}

FROM --platform=$BUILDPLATFORM ghcr.io/b3partners/tailormap-api:${API_VERSION}
FROM --platform=$BUILDPLATFORM ghcr.io/tailormap/tailormap-api:${API_VERSION}

LABEL org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.description="Tailormap" \
org.opencontainers.image.vendor="B3Partners BV" \
org.opencontainers.image.title="Tailormap" \
org.opencontainers.image.url="https://github.com/B3Partners/tailormap-viewer/" \
org.opencontainers.image.source="https://github.com/B3Partners/tailormap-viewer/" \
org.opencontainers.image.documentation="https://github.com/B3Partners/tailormap-viewer/" \
org.opencontainers.image.url="https://github.com/Tailormap/tailormap-viewer/" \
org.opencontainers.image.source="https://github.com/Tailormap/tailormap-viewer/" \
org.opencontainers.image.documentation="https://github.com/Tailormap/tailormap-viewer/" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.base.name="b3partners/tailormap-api:$API_VERSION" \
org.opencontainers.image.base.name="tailormap/tailormap-api:$API_VERSION" \
tailormap-api.version=$API_VERSION

COPY --from=builder /app/dist/app static/
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ database. The default database name, user and password are all `tailormap`:
createuser tailormap
createdb tailormap --owner=tailormap
psql tailormap -c "alter role tailormap password 'tailormap'"
docker run -it --rm --network=host --name tailormap ghcr.io/b3partners/tailormap:snapshot
docker run -it --rm --network=host --name tailormap ghcr.io/tailormap/tailormap:snapshot
```

Specify the following command line parameters with `docker run` to change the database connection settings:
Expand Down Expand Up @@ -126,7 +126,7 @@ released.

## Adding extra functionality

See the [tailormap-starter](https://github.com/B3Partners/tailormap-starter/) and [tailormap-hello-world](https://github.com/B3Partners/tailormap-hello-world/)
See the [tailormap-starter](https://github.com/Tailormap/tailormap-starter/) and [tailormap-hello-world](https://github.com/Tailormap/tailormap-hello-world/)
repositories which demonstrate how you can add functionality to Tailormap by developing it in a separate repository.

General GIS viewer functionality that fits in most viewers can be added in this repository by creating a pull request. If you add
Expand All @@ -138,7 +138,7 @@ build an image which includes multiple Angular libraries (for instance several e
to specify Angular libraries to add when building by setting the `ADD_NG_LIBRARIES` variable (see the comments in `.env.template`). Set the
`TAILORMAP_IMAGE` to a custom name and run `docker compose build`. It will use the Dockerfile and base Angular app from the
`tailormap-starter` repository. For now this will use the published release version of tailormap-viewer that is referenced in the
[package.json](https://github.com/B3Partners/tailormap-starter/blob/main/package.json) in the tailormap-starter repositories' `main`
[package.json](https://github.com/Tailormap/tailormap-starter/blob/main/package.json) in the tailormap-starter repositories' `main`
branch at build time. In the future we aim to have this also use the tailormap-viewer version in the `VERSION` variable by creating the base
app in a schematic from a Dockerfile only.

Expand All @@ -159,7 +159,7 @@ It is explicitly allowed to create a custom Tailormap with closed source (paid)

All used open source components (frontend and backend) have licenses that allow linking with closed source. There are no components licensed
under the GPL or Affero GPL. See [3rdpartylicenses.txt](https://snapshot.tailormap.nl/en/3rdpartylicenses.txt) for all frontend licenses and
[here](https://b3partners.github.io/tailormap-api/dependencies.html) for the licenses used in the backend dependencies.
[here](https://tailormap.github.io/tailormap-api/dependencies.html) for the licenses used in the backend dependencies.

If you extend the Tailormap frontend with closed source frontend functionality, the minified source will of course be delivered to clients'
browsers, even before logging in. By default, source maps (which provide the original source code to developer tools included in browsers)
Expand Down Expand Up @@ -234,7 +234,7 @@ The port PostgreSQL listens on can be customized using the `DB_PORT` variable in

### Using a local Tailormap backend

The Spring Boot backend middleware is developed in a separate [tailormap-api](https://www.github.com/B3Partners/tailormap-api) repository.
The Spring Boot backend middleware is developed in a separate [tailormap-api](https://www.github.com/Tailormap/tailormap-api) repository.

When running a dev server, the tailormap-api is reverse proxied on the `http://localhost:4200/api` path from `https://snapshot.tailormap.nl/api`
which runs the latest `snapshot`, so you don't even need to run the backend and database locally.
Expand All @@ -248,7 +248,7 @@ PROXY_USE_LOCALHOST=true npm run start

There is a Swagger UI for the API on http://localhost:8080/swagger-ui/.

If you want to make some changes to the backend source code, only start the `db` container from this stack and run the backend from the [tailormap-api](https://www.github.com/B3Partners/tailormap-api)
If you want to make some changes to the backend source code, only start the `db` container from this stack and run the backend from the [tailormap-api](https://www.github.com/Tailormap/tailormap-api)
repository as described in the README in that project.

### Code scaffolding
Expand Down Expand Up @@ -277,18 +277,18 @@ After you've made your some changes to the source you can build your own Docker
the `node_modules` and `.angular` directories to reduce the Docker build context size.

```
docker build -t ghcr.io/b3partners/tailormap:snapshot .
docker build -t ghcr.io/tailormap/tailormap:snapshot .
```
or
```
docker compose build
```

The Dockerfile in this repository uses the `ghcr.io/b3partners/tailormap-api` base image with the webserver and backend and adds the Angular
frontend bundles to it. To use your own base image with modifications, run `mvn install` in the [tailormap-api](https://www.github.com/B3Partners/tailormap-api)
The Dockerfile in this repository uses the `ghcr.io/tailormap/tailormap-api` base image with the webserver and backend and adds the Angular
frontend bundles to it. To use your own base image with modifications, run `mvn install` in the [tailormap-api](https://www.github.com/Tailormap/tailormap-api)
repository to build the base image before building the `tailormap` image.

You can also add the argument `--build-arg API_VERSION=snapshot` to set the tag of the `ghcr.io/b3partners/tailormap-api` base image to use.
You can also add the argument `--build-arg API_VERSION=snapshot` to set the tag of the `ghcr.io/tailormap/tailormap-api` base image to use.

### Multi-arch build with Docker buildx

Expand All @@ -312,7 +312,7 @@ export BASE_HREF=/
# for pushing to the GitHub container registry, you need to be logged in with docker login
docker buildx build --pull --build-arg VERSION=${VERSION} --build-arg API_VERSION=${VERSION} --build-arg BASE_HREF=${BASE_HREF} \
--platform linux/amd64,linux/arm64 \
-t ghcr.io/b3partners/tailormap:${VERSION} . \
-t ghcr.io/tailormap/tailormap:${VERSION} . \
--push
# leave the buildx context
docker buildx use default
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ volumes:
services:
tailormap:
container_name: ${COMPOSE_PROJECT_NAME}-server
image: ${TAILORMAP_IMAGE:-ghcr.io/b3partners/tailormap}:${VERSION:-snapshot}
image: ${TAILORMAP_IMAGE:-ghcr.io/tailormap/tailormap}:${VERSION:-snapshot}
# Building is optional, only when adding extra Angular libraries with additional components
build:
# This GitHub repository contains an empty Angular project with the NPM packages from tailormap as
# dependencies
context: https://github.com/B3Partners/tailormap-starter.git
context: https://github.com/tailormap/tailormap-starter.git
args:
API_VERSION: ${VERSION}
ADD_NG_LIBRARIES: ${ADD_NG_LIBRARIES:-}
Expand Down

0 comments on commit ad46536

Please sign in to comment.