Skip to content

Commit

Permalink
base
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealKLH committed Jun 19, 2024
1 parent 91e74c3 commit 0e3abec
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
#**/docker-compose*
#**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
92 changes: 92 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
schedule:
- cron: '27 9 * * *'
push:
branches: [ v5-docker ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ v5-docker ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: docker
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Image Name
id: string
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ env.IMAGE_NAME }}

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ steps.string.outputs.lowercase }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
# platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
# push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

pushover-actions:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # required to clone your code
- name: pushover-actions
uses: umahmood/pushover-actions@main
env:
PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }}
PUSHOVER_USER: ${{ secrets.PUSHOVER_USER }}
with:
status: ${{ job.status }}
title: 'VRipper docker build status'
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
.DS_Store
.settings/
.vscode/

/**/*/static
/**/*/node_modules
/**/*/target
/**/*/build-dir
/**/*/java-runtime

.idea
.vripper
.vripper
.release-env
.classpath
.docker-creds
.project
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
network-timeout 300000
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM maven:3.9.6 AS build

RUN mkdir /build
COPY . /build

WORKDIR /build
RUN mvn clean package -Dmaven.test.skip=true

FROM eclipse-temurin:21-jre-alpine AS run

ARG VERSION
ENV VERSION=${VERSION:-5.8.0}
ENV JAR_FILE=vripper-web-${VERSION}.jar
ENV VRIPPER_DIR=/vripper

RUN mkdir ${VRIPPER_DIR}
COPY --from=build /build/vripper-web/target/${JAR_FILE} ${VRIPPER_DIR}
WORKDIR ${VRIPPER_DIR}
RUN mkdir downloads

EXPOSE 8080/tcp

CMD java -Duser.dir=${VRIPPER_DIR}/base -Duser.home=${VRIPPER_DIR}/downloads -jar ${VRIPPER_DIR}/${JAR_FILE}
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

vripper:
# container_name: vripper
image: ghcr.io/therealklh/vripper-project:latest
ports:
- "8080:8080/tcp"
volumes:
- "./base:/vripper/base"
- "./downloads:/vripper/downloads"
restart: "unless-stopped"

0 comments on commit 0e3abec

Please sign in to comment.