-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Fix] dev 환경 에러 해결
- Loading branch information
Showing
4 changed files
with
59 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
FROM openjdk:17-oracle | ||
COPY gradlew . | ||
COPY gradle gradle | ||
COPY build.gradle . | ||
COPY settings.gradle . | ||
COPY src src | ||
RUN chmod +x ./gradlew | ||
RUN ./gradlew build -x test | ||
# 프로젝트 소스 폴더 복사 | ||
COPY src src | ||
# gradlew 빌드 | ||
RUN ./gradlew bootjar | ||
ARG JAR_FILE=/build/libs/*.jar | ||
RUN mkdir -p /logs | ||
|
||
ENV PROFILE defaultgi | ||
ENV TZ=Asia/Seoul | ||
|
||
ARG JAVA_OPTS | ||
|
||
ARG RELEASE_VERSION | ||
ENV DD_VERSION=${RELEASE_VERSION} | ||
|
||
ARG JAR_FILE="./build/libs/*.jar" | ||
COPY ${JAR_FILE} app.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java", "-jar", "/*.jar"] | ||
ENTRYPOINT ["java", "-jar", "/app.jar"] |
26 changes: 26 additions & 0 deletions
26
BE/eeos/src/main/java/com/blackcompany/eeos/config/WebMvcConfig.java
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,26 @@ | ||
package com.blackcompany.eeos.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.EnableWebMvc; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
@EnableWebMvc | ||
@RequiredArgsConstructor | ||
public class WebMvcConfig implements WebMvcConfigurer { | ||
private final long MAX_AGE_SECS = 3600; | ||
public static final String ALLOWED_METHOD_NAMES = "GET,HEAD,POST,PUT,DELETE,TRACE,OPTIONS,PATCH"; | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry | ||
.addMapping("/api/**") | ||
.allowedOrigins("http://localhost:3000", "https://black-company-upstream.vercel.app/") | ||
.allowedMethods(ALLOWED_METHOD_NAMES.split(",")) | ||
.exposedHeaders("Authorization") | ||
.allowCredentials(true) | ||
.maxAge(MAX_AGE_SECS); | ||
} | ||
} |
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,19 @@ | ||
spring: | ||
config: | ||
activate: | ||
on-profile: dev-mysql | ||
datasource: | ||
url: ${DATASOURCE_URL} | ||
username: ${DATASOURCE_USERNAME} | ||
password: ${DATASOURCE_PASSWORD} | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
jpa: | ||
hibernate: | ||
ddl-auto: create | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
|
||
logging: | ||
level: | ||
sql: debug |
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ spring: | |
group: | ||
local: | ||
- local-mysql | ||
dev: | ||
- dev-mysql | ||
active: local |