diff --git a/docker/demo/DOCKERFILE b/docker/demo/DOCKERFILE index e9e3e0de..99f7d04c 100644 --- a/docker/demo/DOCKERFILE +++ b/docker/demo/DOCKERFILE @@ -1,7 +1,15 @@ -FROM java:openjdk-8 - +FROM alpine/git WORKDIR /demo +RUN git clone https://github.com/SafeExamBrowser/seb-server.git +FROM maven:3.5-jdk-8-alpine +WORKDIR /demo +COPY --from=0 /demo/seb-server /demo +RUN mvn clean install -e -P Demo -DskipTests + +FROM openjdk:8-jre-alpine +WORKDIR /demo +COPY --from=1 /demo/target/seb-server-0.1.0-SNAPSHOT.jar /demo EXPOSE 8090 - -ENTRYPOINT ["java","-jar",".\seb-server-0.1.0-SNAPSHOT.jar","--spring.config.location=classpath:/config/,file:/externalResources/","--spring.profiles.active=dev"] \ No newline at end of file +ENTRYPOINT ["sh", "-c"] +CMD ["java -jar seb-server-0.1.0-SNAPSHOT.jar --spring.config.location=classpath:/config/,file:/demo/externalResources/ --spring.profiles.active=demo"] \ No newline at end of file diff --git a/src/main/java/ch/ethz/seb/sebserver/SEBServer.java b/src/main/java/ch/ethz/seb/sebserver/SEBServer.java index 234c316f..f6f54e55 100644 --- a/src/main/java/ch/ethz/seb/sebserver/SEBServer.java +++ b/src/main/java/ch/ethz/seb/sebserver/SEBServer.java @@ -10,8 +10,10 @@ package ch.ethz.seb.sebserver; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; @SpringBootApplication(exclude = { // OAuth2ResourceServerAutoConfiguration.class, @@ -19,6 +21,7 @@ import org.springframework.context.annotation.Configuration; //DataSourceAutoConfiguration.class }) @Configuration +@Import(DataSourceAutoConfiguration.class) public class SEBServer { public static void main(final String[] args) { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java index 9c9df5a3..c91a8140 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/oauth/AuthorizationServerConfig.java @@ -12,8 +12,10 @@ import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.core.annotation.Order; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.crypto.password.PasswordEncoder; @@ -42,6 +44,7 @@ import ch.ethz.seb.sebserver.webservice.weblayer.WebServiceUserDetails; @Configuration @EnableAuthorizationServer @Order(100) +@Import(DataSourceAutoConfiguration.class) public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter { @Autowired