Skip to content

Commit

Permalink
Add GitHub Actions workflow for Docker image build and update server …
Browse files Browse the repository at this point in the history
…port configuration
  • Loading branch information
athrvk committed Dec 12, 2024
1 parent 31f5ddd commit b5efe80
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker Image

on:
push:
branches:
- master
pull_request:
branches:
- msater

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: athrvk/tic-tac-two:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ RUN mvn clean package
FROM openjdk:17-slim
WORKDIR /app
COPY --from=backend-build /app/backend/target/*.jar ./app.jar
EXPOSE 8080
EXPOSE 10000
CMD ["java", "-jar", "app.jar"]
8 changes: 8 additions & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set server port from environment variable PORT, default to 8080 if not set
server.port=${PORT:8080}

# Spring application name
spring.application.name=TicTacTwo

# Logging configuration
logging.level.root=INFO

0 comments on commit b5efe80

Please sign in to comment.