add docker files
Some checks failed
Gitea Action Maven build / build (push) Successful in 48s
Gitea Action Maven build / deploy (push) Failing after 7s

This commit is contained in:
Eduard Kuksa 2025-02-13 21:28:05 +07:00
parent 4b40ca0599
commit 84141a0e74
3 changed files with 18 additions and 1 deletions

View File

@ -60,5 +60,7 @@ jobs:
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy to Local Server
run: |
scp -r target/*.jar ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
scp -r target/*.jar ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}target/
scp Dockerfile ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
scp docker-compose.yml ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM openjdk:21-jdk-slim
WORKDIR /app
COPY target/spring-demo-0.1.1-SNAPSHOT.jar /app
EXPOSE 8080
CMD ["java", "-jar", "spring-demo-0.1.1-SNAPSHOT.jar"]

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
image: spring-demo
container_name: spring-demo
ports:
- "8082:8080"
restart: always