mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
add docker support
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# ignore everything
|
||||||
|
*
|
||||||
|
|
||||||
|
# allow only what we need
|
||||||
|
!commafeed-server/target/commafeed.jar
|
||||||
|
!commafeed-server/config.yml.example
|
||||||
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@@ -1,28 +1,48 @@
|
|||||||
name: Java CI
|
name: Java CI
|
||||||
|
|
||||||
on: [push]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: ["8", "11", "17"]
|
java: [ "8", "11", "17" ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Java
|
- name: Set up Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
cache: "maven"
|
cache: "maven"
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn --batch-mode --update-snapshots verify
|
run: mvn --batch-mode --update-snapshots verify
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ matrix.java == '8' }}
|
if: ${{ matrix.java == '8' }}
|
||||||
with:
|
with:
|
||||||
name: commafeed.jar
|
name: commafeed.jar
|
||||||
path: commafeed-server/target/commafeed.jar
|
path: commafeed-server/target/commafeed.jar
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
- name: Login to Container Registry
|
||||||
|
if: ${{ github.ref_type == 'tag' && matrix.java == '8' }}
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.ref_type == 'tag' && matrix.java == '8' }}
|
||||||
|
tags: |
|
||||||
|
athou/commafeed:latest
|
||||||
|
athou/commafeed:${{ github.ref_name }}
|
||||||
|
|||||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM openjdk:17-alpine
|
||||||
|
|
||||||
|
RUN mkdir -p /commafeed/data
|
||||||
|
VOLUME /commafeed/data
|
||||||
|
|
||||||
|
ENV CF_SESSION_PATH=/commafeed/data/sessions
|
||||||
|
|
||||||
|
COPY commafeed-server/target/commafeed.jar .
|
||||||
|
COPY commafeed-server/config.yml.example config.yml
|
||||||
|
|
||||||
|
EXPOSE 8082
|
||||||
|
CMD ["java", "-Djava.net.preferIPv4Stack=true", "-jar", "commafeed.jar", "server", "config.yml"]
|
||||||
@@ -87,7 +87,7 @@ app:
|
|||||||
|
|
||||||
database:
|
database:
|
||||||
driverClass: org.h2.Driver
|
driverClass: org.h2.Driver
|
||||||
url: jdbc:h2:/home/commafeed/db
|
url: jdbc:h2:/commafeed/data/db
|
||||||
user: sa
|
user: sa
|
||||||
password: sa
|
password: sa
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
Reference in New Issue
Block a user