-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/docker #33
Merged
Merged
Feature/docker #33
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
391d68c
feature::add docker-compose.yml
HyunJunSon fc55b5a
feature::docker test1
HyunJunSon 033b9df
feature::docker test2
HyunJunSon a9c52e1
feature::docker test3
HyunJunSon 47947e8
Merge branch 'Kernel360:develop' into feature/docker
HyunJunSon 4eb044c
feature::docker test4
HyunJunSon 3cfc4d3
feature::docker test5
HyunJunSon 7cec06d
feature::docker test6
HyunJunSon 419ef7f
feature::docker test7
HyunJunSon c48c111
feature::docker test8
HyunJunSon 4918400
feature::docker test9
HyunJunSon f2be0b4
feature::docker test10
HyunJunSon 0e5ca6c
feature::docker test11
HyunJunSon 3148cd5
feature::docker test12
HyunJunSon e9b7157
feature::docker test12
HyunJunSon c45a401
feature::docker test14
HyunJunSon ee31d28
feature::docker + githubActions CI๊ธฐ๋ฅ์ถ๊ฐ
HyunJunSon a4dcbd7
Merge branch 'Kernel360:develop' into feature/docker
HyunJunSon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Java CI with Gradle | ||
name: Java CI with Gradle and Docker for WashPedia Project | ||
|
||
on: | ||
push: | ||
|
@@ -31,10 +31,12 @@ jobs: | |
|
||
# Gradle Build๋ฅผ ์ํ ๊ถํ ๋ถ์ฌ | ||
- name: Grant execute permission for gradlew | ||
working-directory: ./module-api | ||
run: chmod +x ./gradlew | ||
|
||
# Gradle Build (test ์ ์ธ) | ||
- name: Build with Gradle | ||
working-directory: ./module-api | ||
run: ./gradlew clean build -x test | ||
|
||
# DockerHub ๋ก๊ทธ์ธ | ||
|
@@ -43,17 +45,28 @@ jobs: | |
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
# DockerCompose ์ธํ | ||
- name: Set up Docker Compose | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: ./docker-compose.yml | ||
env: | ||
services.db-edit.environment.POSTGRES_USER: ${{ secrets.POSTGRE_USER }} | ||
services.db-edit.environment.POSTGRES_PASSWORD: ${{ secrets.POSTGRE_PASSWORD }} | ||
services.webapp.image: ${{ secrets.DOCKER_IMAGE }} | ||
|
||
# Docker ์ด๋ฏธ์ง ๋น๋ | ||
- name: Docker Image Build | ||
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.PROJECT_NAME }} . --platform=linux/amd64 | ||
- name: Docker Compose Build | ||
run: docker-compose build | ||
|
||
# DockerHub Push | ||
- name: DockerHub Push | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.PROJECT_NAME }} | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.PROJECT_NAME }}:latest | ||
|
||
# deploy: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# steps:cd | ||
# | ||
# - name: Application Run | ||
# uses: appleboy/[email protected] | ||
|
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,49 @@ | ||
version: '3.8' | ||
services: | ||
webapp: | ||
build: ./module-api | ||
image: ${IMAGE} | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- db-edit | ||
|
||
# batch: | ||
# build: ./module-batch | ||
# ports: | ||
# - "8082:8080" | ||
# depends_on: | ||
# - db-edit | ||
# | ||
# admin: | ||
# build: ./module-admin | ||
# ports: | ||
# - "8083:8080" | ||
# depends_on: | ||
# - db-read | ||
|
||
db-edit: | ||
image: younglong/pg-washpedia:latest | ||
volumes: | ||
- ./postgreReadOnlyDB:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_DB: edit_db | ||
POSTGRES_USER: ${USER} | ||
POSTGRES_PASSWORD: ${PASSWORD} | ||
ports: | ||
- "5432:5432" | ||
|
||
# db-read: | ||
# image: younglong/pg-washpedia:latest | ||
# volumes: | ||
# - postgreEditDB:/var/lib/postgresql/data | ||
# environment: | ||
# POSTGRES_DB: read_db | ||
# POSTGRES_USER: ${{ secrets.PROJECT_USER }} | ||
# POSTGRES_PASSWORD: ${{ secrets.POSTGRE_PASSWORD }} | ||
# ports: | ||
# - "5433:5433" | ||
|
||
volumes: | ||
db-read-volume: {} | ||
db-edit-volume: {} |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
FROM openjdk:17-jdk | ||
CMD ["./gradlew", "clean", "build"] | ||
ARG JAR_FILE=module-api/build/libs/washpedia-0.0.1-SNAPSHOT.jar | ||
ARG JAR_FILE=./build/libs/module-api-0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} washpedia.jar | ||
ENTRYPOINT ["java", "-jar", "washpedia.jar"] | ||
ENTRYPOINT ["java", "-jar", "washpedia.jar"] | ||
|
||
|
||
|
||
|
||
|
33 changes: 6 additions & 27 deletions
33
module-api/src/main/java/com/kernel360/member/controller/MemberController.java
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 |
---|---|---|
@@ -1,38 +1,17 @@ | ||
package com.kernel360.member.controller; | ||
|
||
import ch.qos.logback.core.model.Model; | ||
|
||
import com.kernel360.member.dto.MemberDto; | ||
import com.kernel360.member.service.MemberService; | ||
import com.kernel360.utils.JWT; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/member/") | ||
@RequestMapping("/member") | ||
public class MemberController { | ||
|
||
private final MemberService memberService; | ||
|
||
/** ๊ฐ์ **/ | ||
@PostMapping("/join") | ||
public ResponseEntity<Model> joinMember (@ModelAttribute MemberDto joinRequestDto){ | ||
|
||
try{ | ||
memberService.joinMember(joinRequestDto); | ||
}catch (IllegalArgumentException args){ | ||
log.error("๊ฐ์ ์๋ฌ๋ฐ์", args); | ||
} | ||
|
||
return new ResponseEntity<>(null, HttpStatus.CREATED); | ||
public String signup(@RequestBody MemberDto memberDto ) { | ||
return "member/signup"; | ||
} | ||
|
||
|
||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
working-directory์ depth ๋ฌธ์ ์๋ค๋ ๊ฒ์ด๊ตฐ์. ๊ณ ์ํ์ จ์ต๋๋ค.