Skip to content

Commit

Permalink
Merge branch 'develop_back' into ARCH-114-feat/app-login
Browse files Browse the repository at this point in the history
  • Loading branch information
seokho-1116 authored Jan 17, 2024
2 parents 18131b1 + 9646d9f commit 72d7efa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
30 changes: 11 additions & 19 deletions backend/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
FROM openjdk:17-ea-slim as build
FROM eclipse-temurin:17-jre as build
WORKDIR /workspace/app

# Copy Gradle wrapper and other necessary files
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
COPY src src

RUN apt-get update && apt-get install -y findutils

# Execute the Gradle build
RUN ./gradlew build -x test
COPY build/libs/ .

# Unpack the built application
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../../build/libs/*.jar)
RUN mkdir -p target/extracted
RUN java -Djarmode=layertools -jar *.jar extract --destination target/extracted

FROM openjdk:17-ea-slim
FROM eclipse-temurin:17-jre
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/target/dependency
ARG EXTRACTED=/workspace/app/target/extracted

# Copy over the unpacked application
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
COPY --from=build ${EXTRACTED}/dependencies/ ./
COPY --from=build ${EXTRACTED}/spring-boot-loader/ ./
COPY --from=build ${EXTRACTED}/snapshot-dependencies/ ./
COPY --from=build ${EXTRACTED}/application/ ./

# Run the application
ENTRYPOINT ["java","-cp","app:app/lib/*","site.timecapsulearchive.core.CoreApplication"]
ENTRYPOINT ["java","-Dspring.profiles.active=dev","org.springframework.boot.loader.JarLauncher"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
Expand Down Expand Up @@ -40,6 +41,11 @@ public PasswordEncoder getPasswordEncoder() {
return new BCryptPasswordEncoder();
}

@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring().requestMatchers("/v3/api-docs/**", "/swagger-resources/**", "/swagger-ui/**");
}

@Bean
@Order(1)
public SecurityFilterChain filterChainWithOAuth(HttpSecurity http) throws Exception {
Expand Down Expand Up @@ -77,8 +83,6 @@ public SecurityFilterChain filterChainWithJwt(
http
.securityMatcher(regexMatcher("^\\/(?!auth\\/login).*"))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/v3/api-docs/**", "/swagger-resources/**", "/swagger-ui/**")
.permitAll()
.anyRequest().authenticated()
);

Expand Down
2 changes: 1 addition & 1 deletion backend/core/src/main/resources/config

0 comments on commit 72d7efa

Please sign in to comment.