Skip to content

Instantly share code, notes, and snippets.

View slominskir's full-sized avatar

Ryan Slominski slominskir

View GitHub Profile
@slominskir
slominskir / software-dev.md
Last active April 16, 2024 16:05
software-dev
@slominskir
slominskir / README_Template.md
Last active August 30, 2023 16:59
README.md template

project (badges go here: CI and Artifact Repo status such as DockerHub, Maven Central, PyPi, or NPM)

Short description goes here

Screenshot


@slominskir
slominskir / SameOrigin.md
Created December 15, 2022 18:34
Same Origin

Unlike users who can navigate web browsers to any website to make requests, client-side JavaScript programs are limited by the browsers they're running in to only requests to the same host (origin) from which the script came, unless CORS is configured. In practice one of the best ways to deal with this security restriction is often to simply serve dependent apps from the same origin. In Java this is often accomplish with application servers (such as Tomcat and Wildfly) that encourage multiple applications running on the same server (and JVM). Another common strategy to serve from the same origin is to leverage a reverse proxy server such as Apache httpd or HAProxy as this allows separate backend servers.

@slominskir
slominskir / SetupKeycloak.md
Last active March 20, 2023 13:31
Setup Keycloak

Host OS Setup

Docker

Just use pre-built image to start with:

FROM quay.io/keycloak/keycloak:latest

RHEL 9

Use a Bash script to download Keycloak, and configure OS. Assumes you create a host.env config file and a /run/keycloak.env file:

@slominskir
slominskir / SetupWildfly.md
Last active April 19, 2023 18:25
Setup Wildfly

Host OS Setup

Docker

Just use pre-built image to start with:

FROM quay.io/wildfly/wildfly:26.1.2.Final

RHEL 9

@slominskir
slominskir / DockerBuildStrategy.md
Last active February 24, 2023 16:31
How to use docker build to satisfy multiple use cases

Docker Build Strategy

This document describes how to leverage docker build for multiple use cases. The two use cases covered are:

Use Case Description Command
Remote Source Build your app image in the most reproducible way possible. Repeat: this case must be painless for users and as reproducable as possible. Assumes nothing is available in your local docker build context and instead the context is fetched from a URL. This is the build to use when creating a tagged image for a repository. docker build https://github.com/<user>/<project>.git#<tag>
Local Source Build your app image assuming that the local docker build context includes the source files you need. This can be convenient during development, but can be problematic in some CI environments that have different assumptions about build context. Leverages docker COPY and can potentia
@slominskir
slominskir / DockerComposeStrategy.md
Last active September 27, 2023 14:00
How to use docker compose to satisfy multiple use cases with minimal duplication of services

Docker Compose Strategy

This document describes how to leverage docker compose for multiple use cases while minimizing duplication of services. The use cases covered are:

Type Use Case Description Command
Demo Quick start demo As easily as possible run your app (with all services it depends on) for demonstration purposes. Repeat: this case must be as painless as possible. Uses a tagged image for all containers (no Dockerfile / docker build). docker compose up
Test Integration testing Leverage CI actions / custom scripts to run integration tests. Alternatively use favorite container test framework such as testcontainers.org to run automated integration tests. In Java interfaces with JUnit; in Python usually interfaces with pytest. Most container test frameworks support launching from compose file, but often limited so may need to use framework API to defi
@slominskir
slominskir / GradlePublishLib.md
Last active February 28, 2023 12:37
Gradle Maven Publish Notes

We rely on the Gradle build tool and the "maven-publish" plugin to publish library artifiacts to Maven Repositories.

Where to publish

There are a few common repos:

  1. Maven Central (via Sonatype OSSRH)
  2. GitHub Maven Repo
  3. Gradle Plugin Portal

Authorization

@slominskir
slominskir / GradleProperties.md
Last active January 11, 2021 13:43
Gradle user config notes

In order to define user-level Gradle properties such as GitHub and BinTray tokens create a file at ~/.gradle/gradle.properties and ensure you have the environment variable GRADLE_USER_HOME (includes .gradle directory) or USER_HOME (excludes .gradle directory) defined.