This commit is contained in:
parent
91a24dc7e1
commit
c53e1fd6bf
31
.gitea/workflows/deploy.yml
Normal file
31
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,31 @@
|
||||
name: Deploy API
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- README.md
|
||||
- LICENSE
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["ubuntu-latest"]
|
||||
git-version: ["2.44.0"]
|
||||
runs-on: ${{ matrix.arch }}
|
||||
|
||||
# Steps to run
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Deploy to Dokku
|
||||
- name: Deploy to Dokku
|
||||
uses: dokku/github-action@master
|
||||
with:
|
||||
git_remote_url: "ssh://dokku@10.10.3.28:22/tether"
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
# Stage 1: Build the application
|
||||
FROM maven:3.9.6-eclipse-temurin-17-alpine AS builder
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /home/container
|
||||
|
||||
# Copy the current directory contents into the container at /home/container
|
||||
COPY . .
|
||||
|
||||
# Build the jar
|
||||
RUN mvn package -q -Dmaven.test.skip -DskipTests -T2C -s ./settings.xml
|
||||
|
||||
# Stage 2: Create the final lightweight image
|
||||
FROM eclipse-temurin:17.0.11_9-jre-focal
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /home/container
|
||||
|
||||
# Copy the built jar file from the builder stage
|
||||
COPY --from=builder /home/container/target/Tether.jar .
|
||||
|
||||
# We're running in production
|
||||
ENV APP_ENV "production"
|
||||
|
||||
# Run the jar file
|
||||
CMD java -jar Tether.jar -Djava.awt.headless=true
|
Loading…
x
Reference in New Issue
Block a user