Feature: adds Docker packaging with docker profile + Clean: unused dependencies and testing

This commit is contained in:
fecaille
2016-03-25 14:22:00 +01:00
parent c776f5d0f8
commit 1c00864580
7 changed files with 88 additions and 323 deletions

View File

@@ -0,0 +1,34 @@
FROM alpine:3.2
ENV JRE=jre1.8.0_77 \
JAVA_HOME=/opt/jre
# That's an 1.8.0_60 JRE from OpenJDK.net
# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed
RUN apk add --update wget curl ca-certificates && \
cd /tmp && \
wget -q "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" \
"https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk" && \
apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk && \
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
mkdir /opt && \
curl -sL -o /tmp/${JRE}.tgz --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" -q "http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jre-8u77-linux-x64.tar.gz" && \
cd /opt && tar xzf /tmp/${JRE}.tgz && \
ln -s /opt/${JRE} /opt/jre && \
ln -s /opt/jre/bin/java /usr/bin/java && \
apk del wget curl ca-certificates && \
cd /opt/jre/lib/amd64 && rm libjavafx_* libjfx* libfx* && \
cd /opt/jre/lib/ && rm -rf ext/jfxrt.jar jfxswt.jar javafx.properties font* && \
rm /tmp/* /var/cache/apk/*
VOLUME /tmp
EXPOSE 8080
ADD app.jar /
RUN sh -c 'touch /app.jar'
CMD ["sh"]
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

View File

@@ -1,37 +0,0 @@
package com.opengroupe.cloud.saas.config;
import org.springframework.context.annotation.Bean;
import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
import org.thymeleaf.templateresolver.TemplateResolver;
import org.thymeleaf.templateresolver.UrlTemplateResolver;
@org.springframework.context.annotation.Configuration
public class WebMvcConfiguration {
// @Bean
// public TemplateResolver templateResolver() {
// TemplateResolver templateResolver = new ThymeleafViewResolver().;
// templateResolver.setPrefix("/resources/templates");
// templateResolver.setSuffix(".html");
// templateResolver.setTemplateMode("HTML5");
// templateResolver.setCacheable(false);
// return templateResolver;
// }
// @Bean
// public UrlTemplateResolver urlTemplateResolver() {
// return new UrlTemplateResolver();
// }
// @Bean
// public SpringTemplateEngine templateEngine() {
// SpringTemplateEngine templateEngine = new SpringTemplateEngine();
//// templateEngine.addTemplateResolver(templateResolver());
// templateEngine.addTemplateResolver(urlTemplateResolver());
// templateEngine.addDialect(new SpringSecurityDialect());
// return templateEngine;
// }
}

View File

@@ -1,20 +0,0 @@
package com.opengroupe.cloud.saas.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
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.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers(HttpMethod.GET, "/**").anonymous()
.antMatchers(HttpMethod.POST, "/api/**").anonymous()
.anyRequest().permitAll();
}
}

View File

@@ -23,12 +23,9 @@
<li><a href="#" th:href="@{/task}">Tasks</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li th:if="${#authorization.expression('!isAuthenticated()')}">
<li>
<a href="/signin" th:href="@{/signin}">Sign in</a>
</li>
<li th:if="${#authorization.expression('isAuthenticated()')}">
<a href="/logout" th:href="@{/logout}">Logout</a>
</li>
</ul>
</div>
</div>