Skip to content

Commit

Permalink
Merge pull request #13 from kssumin/fix/#52/column
Browse files Browse the repository at this point in the history
[Fix] dev 환경 에러 해결
  • Loading branch information
kssumin authored Nov 3, 2023
2 parents bdda938 + 29c720f commit 4359736
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 14 deletions.
26 changes: 12 additions & 14 deletions BE/eeos/Dockerfile
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"]
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);
}
}
19 changes: 19 additions & 0 deletions BE/eeos/src/main/resources/application-dev-mysql.yml
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
2 changes: 2 additions & 0 deletions BE/eeos/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ spring:
group:
local:
- local-mysql
dev:
- dev-mysql
active: local

0 comments on commit 4359736

Please sign in to comment.