add docker files

This commit is contained in:
FireMasterK 2021-01-05 10:56:43 +05:30
parent 3092ec4b27
commit f7ff7afcf9
No known key found for this signature in database
GPG key ID: 8DFF5DD33E93DB58
4 changed files with 66 additions and 1 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
.*
build
bin
Dockerfile
*.bat
LICENSE
*.md
config.properties

38
.github/workflows/docker-build.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Docker Multi-Architecture Build
on:
push:
paths-ignore:
- "**.md"
branches:
- master
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 1337kavin/piped:latest

4
.gitignore vendored
View file

@ -5,12 +5,14 @@ bin/
.*
!.gitignore
!.dockerignore
!.github/
# Log file
*.log
### Gradle ###
/.gradle
/build/
# TxT File

17
Dockerfile Normal file
View file

@ -0,0 +1,17 @@
FROM adoptopenjdk/openjdk11:jdk11u-ubi-nightly-slim AS build
WORKDIR /app/
COPY . /app/
RUN chmod +x ./gradlew && ./gradlew shadowJar
FROM adoptopenjdk/openjdk11:ubi-minimal-jre
WORKDIR /app/
COPY --from=build /app/build/libs/piped-1.0-all.jar /app/piped.jar
EXPOSE 8080
CMD java -jar /app/piped.jar