Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav Shah initcron

View GitHub Profile
@initcron
initcron / docker-compose.yaml
Last active July 28, 2022 05:11
Docker Compose v3 for instavote app with Postgres Fix
version: "3"
networks:
vote:
driver: bridge
volumes:
db-data:
services:
vote:
@initcron
initcron / wsl2-connect.md
Created June 17, 2022 03:31
Connecting to Docker Desktop Host with WSL2
C:\Users\xyz> wsl -l

[sample output] Windows Subsystem for Linux Distributions: docker-desktop-data (Default) docker-desktop Ubuntu

@initcron
initcron / Dockerfile
Created May 25, 2022 10:44
Multi Stage Dockerfile with entry point which adds 10s delay. This fixes the problem of application crashing due to database not being available when it is launched.
FROM schoolofdevops/maven:spring AS BUILD
WORKDIR /app
COPY . .
RUN mvn spring-javaformat:apply && \
mvn package -DskipTests
FROM openjdk:8u201-jre-alpine AS RUN
EXPOSE 8080
WORKDIR /run
#!/bin/sh
echo "I: Sleeping for 10 secs...."
sleep 10
echo "I: done sleeping..."
exec "$@"
@initcron
initcron / Dockerfile
Last active August 17, 2022 16:27
Multistage for Facebooc
FROM alpine AS build
WORKDIR /opt/facebooc
COPY . .
RUN apk add --update alpine-sdk sqlite-dev sqlite && \
make all
FROM alpine AS run
WORKDIR /opt/facebooc
COPY --from=build /opt/facebooc/bin .
@initcron
initcron / docker-compose.yaml
Last active May 25, 2022 09:53
Docker Compose version 3
version: "3.8"
networks:
backend:
driver: bridge
services:
app:
image: xxxx/petclinic:dev
build:
@initcron
initcron / Dockerfile
Created May 18, 2022 13:09
Multi Stage Dockerfile for Spring Petclinic App. Results in approx 134MB worth image
FROM schoolofdevops/maven:spring AS BUILD
WORKDIR /app
COPY . .
RUN mvn spring-javaformat:apply && \
mvn package -DskipTests
FROM openjdk:8u201-jre-alpine AS RUN
COPY --from=BUILD /app/target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar /run/petclinic.jar
EXPOSE 8080
CMD java -jar /run/petclinic.jar
@initcron
initcron / Jenkinsfile.vote
Created April 27, 2022 03:53
Jenkinsfile for Vote App
pipeline {
agent none
stages{
stage('Build'){
agent{
docker{
image 'python:2.7.16-slim'
@initcron
initcron / vote-sts.yaml
Created April 14, 2022 12:05
StatefuleSet version of Vote App
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: vote
labels:
role: vote
namespace: test
spec:
minReadySeconds: 20
serviceName: vote
@initcron
initcron / vote-ds.yaml
Created April 14, 2022 12:05
DaemonSet version of vote app
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: vote
labels:
role: vote
namespace: test
spec:
minReadySeconds: 20
selector: