File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/main/java/lass9436/config Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ # 빌드 스테이지: Gradle과 JDK 17을 사용하여 WAR 파일 빌드
2
+ FROM gradle:7.6.1-jdk17 AS build
3
+ WORKDIR /app
4
+ COPY . .
5
+ RUN ./gradlew clean build
6
+
7
+ # 실행 스테이지: Tomcat 10.1.26과 JDK 17을 사용하여 WAR 실행
8
+ FROM tomcat:10.1.26-jdk17
9
+ WORKDIR /usr/local/tomcat/webapps/
10
+ COPY --from=build /app/build/libs/*.war ./ROOT.war
11
+
12
+ # 8080 포트 노출 (Tomcat 기본 포트)
13
+ EXPOSE 8080
14
+
15
+ # Tomcat 실행
16
+ CMD ["catalina.sh" , "run" ]
Original file line number Diff line number Diff line change 11
11
12
12
public class Database {
13
13
14
- private static final String url = "jdbc:mysql://localhost :3306/jsp_cafe" ;
14
+ private static final String url = "jdbc:mysql://host.docker.internal :3306/jsp_cafe" ;
15
15
private static final String user = "user" ;
16
16
private static final String password = "1234" ;
17
17
private static final MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource ();
You can’t perform that action at this time.
0 commit comments