File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy Docker Image
2+
3+ on : [push]
4+
5+ jobs :
6+ build-and-deploy :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v2
10+ - name : Build Docker Image
11+ run : |
12+ docker build -t docker.pkg.github.com/yanni8/m295/app:latest .
13+ - name : Login to GitHub Packages
14+ run : |
15+ echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
16+ - name : Push Docker Image
17+ run : |
18+ docker push docker.pkg.github.com/yanni8/m295/app:latest
Original file line number Diff line number Diff line change 1+ FROM maven:3 as builder
2+
3+ WORKDIR /app
4+ COPY . .
5+ RUN mvn -Dmaven.test.skip=true package
6+
7+ FROM openjdk:17-jdk
8+
9+ WORKDIR /home/app
10+ RUN useradd -ms /bin/bash -u 999 app
11+ USER app
12+ COPY --from=builder /app/target/*.jar runner.jar
13+ EXPOSE 8080
14+
15+ ENTRYPOINT ["java" , "-jar" , "runner.jar" ]
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.validation.V
77spring.jpa.show-sql =true
88spring.jpa.generate-ddl =true
99spring.jpa.hibernate.ddl-auto =update
10- spring.datasource.url =jdbc:postgresql://${DB_URL :localhost}:${DB_PORT:5432}/demo
10+ spring.datasource.url =jdbc:postgresql://${DB_HOST :localhost}:${DB_PORT:5432}/demo
1111spring.datasource.username =${DB_USERNAME:postgres}
1212spring.datasource.password =${DB_PASSWORD:password}
1313spring.datasource.driverClassName =org.postgresql.Driver
You can’t perform that action at this time.
0 commit comments