forked from shashirajraja/onlinebookstore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: OnlineBookStoreImageBuild | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-image: | ||
name: Build the image | ||
runs-on: ubuntu:latest | ||
|
||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- run: mvn --batch-mode --update-snapshots verify | ||
- run: mkdir staging && cp target/*.war staging | ||
|
||
- name: Image build using Dockerfile | ||
run : | ||
docker build -t aapurva/java-webapps:v1.0.0 ../Dockerfile | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Use an official Tomcat image as the base | ||
FROM tomcat:9.0-jdk11 | ||
|
||
# Remove the default Tomcat applications | ||
RUN rm -rf /usr/local/tomcat/webapps/* | ||
|
||
# Copy the .war artifact from the artifacts directory to the Tomcat webapps directory | ||
COPY ./staging/*.war /usr/local/tomcat/webapps/ROOT.war | ||
|
||
# Expose the Tomcat port | ||
EXPOSE 8080 | ||
|
||
# Start Tomcat | ||
CMD ["catalina.sh", "run"] |