-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: compose.yml 등 배포 관련 설정 파일 작성 (#43)
* chore: compose.yml 등 배포 관련 설정 파일 작성 refactor: RedisProperty 사용 * chore: compose.yml 수정 MariaDB, Redis 포트 개방 컨테이너 restart 설정 * chore: test task를 위한 application.yml 추가 JWT 관련 속성 test에서 설정 test task, build task 정상화
- Loading branch information
Showing
6 changed files
with
94 additions
and
8 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,69 @@ | ||
services: | ||
web: | ||
image: nginx | ||
restart: always | ||
ports: | ||
- 80:80 | ||
volumes: | ||
- ./client/build:/usr/share/nginx/html:ro | ||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro | ||
depends_on: | ||
- backend | ||
|
||
db: | ||
image: mariadb | ||
restart: always | ||
secrets: | ||
- db-password | ||
volumes: | ||
- db-data:/var/lib/mysql | ||
environment: | ||
- MYSQL_DATABASE=stackoverflow | ||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password | ||
healthcheck: | ||
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --silent'] | ||
interval: 3s | ||
retries: 5 | ||
start_period: 30s | ||
ports: | ||
- 3306:3306 | ||
|
||
redis: | ||
image: redis | ||
restart: always | ||
healthcheck: | ||
test: ["CMD-SHELL", "redis-cli ping | grep PONG"] | ||
interval: 3s | ||
retries: 5 | ||
ports: | ||
- 6379:6379 | ||
|
||
backend: | ||
image: eclipse-temurin:11-jre | ||
restart: always | ||
secrets: | ||
- backend-secrets | ||
command: java -jar app.jar | ||
volumes: | ||
- ./server/build/libs/seb41-41-pre-project-0.0.1-SNAPSHOT.jar:/app.jar:ro | ||
environment: | ||
- SPRING_CONFIG_IMPORT=file:/run/secrets/backend-secrets[.yml] | ||
- SPRING_PROFILES_ACTIVE=server | ||
- SPRING_DATASOURCE_URL=jdbc:mysql://db/stackoverflow | ||
- SPRING_DATASOURCE_USERNAME=root | ||
- SPRING_REDIS_HOST=redis | ||
# - SPRING_JPA_HIBERNATE_DDL-AUTO=create-only # 최초 기동시 스키마 생성을 위해 사용 | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
redis: | ||
condition: service_healthy | ||
|
||
volumes: | ||
db-data: | ||
|
||
secrets: | ||
db-password: | ||
file: ./secrets/db-password | ||
backend-secrets: | ||
file: ./secrets/backend-secrets.yml |
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,15 @@ | ||
events {} | ||
|
||
http { | ||
server { | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri /index.html =404; | ||
} | ||
|
||
location /api/ { | ||
proxy_pass http://backend:8080/api/; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ spring: | |
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
|
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,4 @@ | ||
jwt: | ||
key: kevin12341234123412341234123412341234adsfgeeettwaeaafasfsadf | ||
ATExpiration: 10 | ||
RTExpiration: 420 |