-
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.
* build: docker 개발 환경 설정 * build: docker-compose.yml 추가
- Loading branch information
Showing
17 changed files
with
842 additions
and
104 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,5 @@ | ||
FROM openjdk:17.0.2-slim | ||
ARG JAR_FILE=build/libs/practice-0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} jpa-rest.jar | ||
EXPOSE 9090 | ||
ENTRYPOINT ["java","-Dspring.profiles.active=dev","-jar","jpa-rest.jar"] |
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,17 @@ | ||
#!/bin/bash | ||
repository=dkerhater/jpa-rest | ||
os=linux/amd64 | ||
tagName=dev | ||
|
||
read -p "배포할 버전을 입력하세요:" version | ||
|
||
echo "=>>> Gradle 빌드 중입니다...." | ||
./gradlew clean build | ||
|
||
echo "=>>> 도커 이미지를 생성 중입니다...." | ||
docker build --platform $os -f Dockerfile.dev -t $repository:$version-$tagName . | ||
|
||
echo "=>>> 도커 레포지토리로 이미지를 전송 중입니다...." | ||
docker push $repository:$version-$tagName | ||
|
||
echo "🚀 $repository:$version-$tagName 도커 레포지토리에 이미지 전송을 완료했습니다." |
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,51 @@ | ||
version: "3" | ||
services: | ||
db: | ||
container_name: jparest-mysql | ||
image: mysql | ||
environment: | ||
MYSQL_DATABASE: jparest | ||
MYSQL_ROOT_PASSWORD: 1#9&3!6@ | ||
TZ: Asia/Seoul | ||
volumes: | ||
- ./db/data:/var/lib/mysql:rw | ||
ports: | ||
- "3303:3306" | ||
networks: | ||
- api-network | ||
restart: always | ||
command: | ||
- --character-set-server=utf8mb4 | ||
- --collation-server=utf8mb4_unicode_ci | ||
|
||
redis: | ||
container_name: jparest-redis | ||
image: redis | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- api-network | ||
environment: | ||
TZ: Asia/Seoul | ||
|
||
api: | ||
image: dkerhater/jpa-rest:0.0.1-dev | ||
restart: always | ||
ports: | ||
- "9090:9090" | ||
depends_on: | ||
- db | ||
- redis | ||
container_name: jpa-rest-api | ||
environment: | ||
TZ: Asia/Seoul | ||
SPRING_PROFILES_ACTIVE: dev | ||
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/jparest | ||
SPRING_DATASOURCE_USERNAME: root | ||
SPRING_DATASOURCE_PASSWORD: 1#9&3!6@ | ||
SPRING_REDIS_HOST: redis | ||
networks: | ||
- api-network | ||
|
||
networks: | ||
api-network: |
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
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
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.