Skip to content

Commit

Permalink
chore(deps): remove Java inbuilt docker compose for db (#1376)
Browse files Browse the repository at this point in the history
Co-authored-by: Ricardo Campos <[email protected]>
  • Loading branch information
DerekRoberts and Ricardo Campos authored Jul 10, 2024
1 parent 03baa5c commit 93872cd
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 102 deletions.
7 changes: 1 addition & 6 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ If you want to have all frontend, backend and database, just run:
docker compose up backend -d
```

But if you can see only the backend and databse, run from the `backend` directory:
```sh
./mvnw spring-boot:run -Pdocker-compose -Dspring-boot.run.profiles=docker-compose
```

If you need to change the code, no problem. Once you hit Ctrl+S keys
the service will be restarted! Enjoy

Expand Down Expand Up @@ -124,4 +119,4 @@ pass.
## Getting help

As mentioned, we're here to help. Feel free to start a conversation
on Rocket chat or ask a question on Stackoverflow.
on Rocket chat or ask a question on Stackoverflow.
12 changes: 0 additions & 12 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@
</plugins>
</build>
</profile>

<!-- Docker compose native profile -->
<profile>
<id>docker-compose</id>
</profile>
</profiles>

<dependencies>
Expand Down Expand Up @@ -152,13 +147,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-docker-compose</artifactId>
<version>3.3.0</version>
<optional>true</optional>
<scope>test</scope>
</dependency>

<!-- Geospatial -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AbstractAuthenticationToken;
Expand All @@ -27,7 +26,6 @@
@Configuration
@EnableWebSecurity
@EnableMethodSecurity
@Profile("!docker-compose")
public class SecurityConfig {

@Value("${spring.security.oauth2.resourceserver.jwt.jwk-set-uri}")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package ca.bc.gov.backendstartapi.security;

import ca.bc.gov.backendstartapi.config.SparLog;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.jwt.Jwt;
Expand All @@ -17,8 +13,6 @@
@RequiredArgsConstructor
public class UserAuthenticationHelper {

@Autowired private Environment environment;

/**
* Get the logged user information.
*
Expand Down Expand Up @@ -90,18 +84,6 @@ public Optional<UserInfo> getUserInfo() {

SparLog.info("User not authenticated!");

// Checks if it's the 'docker-compose' profile enabled (local dev env)
boolean isDockerComposeProfile = false;
if (!Objects.isNull(environment)) {
String[] profiles = environment.getActiveProfiles();
isDockerComposeProfile = Arrays.asList(profiles).contains("docker-compose");
}

if (isDockerComposeProfile) {
SparLog.info("Local development environment found! Using dev user!");
return Optional.of(UserInfo.createDevUser());
}

return Optional.empty();
}
}
2 changes: 0 additions & 2 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server.error.include-message=always

# Actuator and ops
management.endpoint.health.show-details = always
spring.docker.compose.enabled = false
spring.docker.compose.file = docker-compose-dev.yml

# Others
nr-spar-backend-version = ${NR_SPAR_BACKEND_VERSION:local}
Expand Down
19 changes: 0 additions & 19 deletions backend/src/main/resources/docker-compose-dev.yml

This file was deleted.

0 comments on commit 93872cd

Please sign in to comment.