-
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.
Merge pull request #31 from bariBari23/docker_setup
chore: 도커로 테스트 돌리는 기능
- Loading branch information
Showing
5 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
Submodule backend-config
updated
from 8c8454 to e4bccb
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,33 @@ | ||
version: '3.8' | ||
services: | ||
mysql: | ||
image: mysql:8.0.32 | ||
hostname: mysql | ||
container_name: mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: demo | ||
ports: | ||
- "3306:3306" | ||
restart: always | ||
|
||
redis: | ||
image: redis:7.0.11 | ||
hostname: redis | ||
container_name: redis | ||
ports: | ||
- "6379:6379" | ||
restart: always | ||
|
||
spring: | ||
hostname: spring | ||
container_name: spring | ||
build: | ||
context: .. | ||
dockerfile: docker/spring/Dockerfile | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- mysql | ||
- redis | ||
restart: always |
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,27 @@ | ||
FROM gradle:7.6.1-jdk17-jammy | ||
|
||
#RUN yum install -y curl | ||
|
||
WORKDIR /app | ||
|
||
# Copy the Gradle configuration files and source code | ||
COPY gradlew /app/ | ||
COPY gradle /app/gradle | ||
COPY build.gradle.kts /app/ | ||
COPY settings.gradle.kts /app/ | ||
COPY backend-config /app/backend-config | ||
COPY src /app/src | ||
|
||
RUN rm -f /app/src/test/resources/application.yml | ||
|
||
# Make the Gradle wrapper executable | ||
RUN chmod +x ./gradlew | ||
|
||
# Copy test resources | ||
|
||
# run test | ||
RUN ./gradlew copyYmlTest | ||
#RUN cat /app/src/test/resources/application.yml | ||
#RUN ./gradlew test | ||
ENTRYPOINT ["./gradlew", "test"] | ||
#ENTRYPOINT ["tail", "-f", "/dev/null"] |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# 현재 스크립트의 디렉토리로 이동 | ||
cd "$(dirname "$0")" | ||
|
||
# Docker Compose 파일이 있는 디렉토리로 이동 | ||
cd ../docker | ||
|
||
# Docker Compose를 사용하여 서비스 종료 | ||
docker-compose down |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# 현재 스크립트의 디렉토리로 이동 | ||
cd "$(dirname "$0")" | ||
|
||
# Docker Compose 파일이 있는 디렉토리로 이동 | ||
cd ../docker | ||
|
||
# Docker Compose를 사용하여 서비스 시작 | ||
docker-compose up --build -d |