Skip to content

Commit 9e484d5

Browse files
authored
Chore/docker set andvariable-68-hwuanPage
* chore/ReadytoDeployv1.0.0-68-HuwanPage * chore/ReadytoDeploymentv1.0.0-68-HuwanPage * remove etc * prod
1 parent 62e120b commit 9e484d5

File tree

7 files changed

+78
-7
lines changed

7 files changed

+78
-7
lines changed

.github/workflows/pr-workflow.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ jobs:
6565
- name: Check out Repository
6666
uses: actions/checkout@v4
6767

68-
- name: Setting for Development
69-
run: echo ${{secrets.PROD_YML}} >src/main/resources/application-prod.yml
70-
7168
- name: Sign in github container registry
7269
uses: docker/login-action@v3
7370
with:

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM gradle:jdk21 as builder
2+
3+
WORKDIR /libs
4+
5+
COPY gradlew .
6+
COPY gradle gradle
7+
COPY build.gradle .
8+
COPY settings.gradle .
9+
10+
RUN ./gradlew dependencies --no-daemon || true
11+
12+
COPY src src
13+
14+
RUN ./gradlew build --no-daemon -x test
15+
16+
FROM openjdk:21-slim
17+
18+
WORKDIR /app
19+
20+
COPY --from=builder /libs/build/libs/*.jar app.jar
21+
22+
ENTRYPOINT [ "java", "-Dspring.profiles.active=prod" , "-jar", "app.jar" ]
23+
24+
25+

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ext {
99
}
1010

1111
group = 'sevenstar'
12-
version = '0.0.1-SNAPSHOT'
12+
version = '1.0.0'
1313

1414
java {
1515
toolchain {

docker-compose.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Marine-Leisure
2+
3+
services:
4+
5+
db:
6+
image: mysql:8.0
7+
networks:
8+
- marine-net
9+
container_name: marine_db
10+
restart: always
11+
environment:
12+
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
13+
MYSQL_DATABASE: marine
14+
MYSQL_USER: ${DB_USERNAME}
15+
MYSQL_PASSWORD: ${DB_PASSWORD}
16+
ports:
17+
- "3306:3306"
18+
volumes:
19+
- db_data:/var/lib/mysql
20+
healthcheck:
21+
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}" ]
22+
timeout: 20s
23+
retries: 10
24+
interval: 10s
25+
start_period: 40s
26+
27+
app:
28+
image: ghcr.io/your-org/your-repo:latest # 최신 이미지 태그
29+
networks:
30+
- marine-net
31+
container_name: marine_app
32+
restart: always
33+
depends_on:
34+
db:
35+
condition: service_healthy
36+
ports:
37+
- "8080:8080"
38+
environment:
39+
DB_USERNAME: ${DB_USERNAME}
40+
DB_PASSWORD: ${DB_PASSWORD}
41+
env_file:
42+
- .env
43+
44+
volumes:
45+
db_data:
46+
47+
networks:
48+
marine-net:
49+
driver: bridge

src/main/resources/application-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spring:
1515
password: ${REDIS_PASSWORD}
1616
datasource:
1717
driver-class-name: com.mysql.cj.jdbc.Driver
18-
url: jdbc:mysql://localhost:3306/marine
18+
url: jdbc:mysql://db:3306/marine
1919
username: ${DB_USERNAME}
2020
password: ${DB_PASSWORD}
2121

src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ spring:
22
application:
33
name: MarineLeisure
44
profiles:
5-
active: dev
5+
active: prod

src/main/resources/data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ VALUES (1, '인천', '2025-07-03', 'LOW', NOW(), NOW()),
3939
(7, '전남', '2025-07-03', 'LOW', NOW(), NOW()),
4040
(7, '강원', '2025-07-03', 'LOW', NOW(), NOW())
4141
ON DUPLICATE KEY UPDATE density_type = VALUES(density_type),
42-
updated_at = NOW();
42+
updated_at = NOW();

0 commit comments

Comments
 (0)