-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a4a786
commit 27ee2d6
Showing
13 changed files
with
279 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
FROM frolvlad/alpine-oraclejdk8:slim | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8282 | ||
EXPOSE 8081 | ||
|
||
COPY data/ /data | ||
ADD target/*.jar app.jar | ||
RUN sh -c 'touch /app.jar' | ||
ENV JAVA_OPTS="" | ||
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ] | ||
|
||
HEALTHCHECK --start-period=10s --interval=5s --timeout=3s --retries=2 \ | ||
CMD wget --spider http://localhost:8081/actuator/health | ||
CMD wget --spider http://localhost:8081/health |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
backend/src/main/java/ch/fablabs/fabjam/cocktail/boot/WebConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package ch.fablabs.fabjam.cocktail.boot; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
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; | ||
|
||
import javax.servlet.*; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
|
||
@Configuration | ||
@EnableWebSecurity | ||
public class WebConfig extends WebSecurityConfigurerAdapter { | ||
|
||
@Bean | ||
public FilterRegistrationBean httpFilter() { | ||
return new FilterRegistrationBean(new Filter() { | ||
@Override | ||
public void init(FilterConfig filterConfig) throws ServletException { | ||
|
||
} | ||
|
||
@Override | ||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException { | ||
HttpServletRequest request = (HttpServletRequest) req; | ||
HttpServletResponse response = (HttpServletResponse) res; | ||
response.setHeader("Access-Control-Allow-Origin", "*"); | ||
response.setHeader("Access-Control-Allow-Methods", "POST, PUT, DELETE, GET, OPTIONS"); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
|
||
} | ||
}); | ||
} | ||
|
||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http | ||
.csrf().disable(); | ||
http | ||
.authorizeRequests().anyRequest().permitAll(); | ||
// http | ||
// .authorizeRequests() | ||
// .antMatchers("/wl/*").permitAll() | ||
// .antMatchers("/dev/*").permitAll() | ||
// .antMatchers("/wl/system/*").hasRole("SYSTEM") | ||
// .and() | ||
// .httpBasic(); | ||
// http | ||
// .headers() | ||
// .cacheControl().disable() | ||
// .frameOptions().sameOrigin(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: '3.0' | ||
services: | ||
proxy: | ||
image: traefik | ||
container_name: baromatic-proxy | ||
ports: | ||
- "80:80" | ||
- "8082:8082" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./traefik.toml:/etc/traefik/traefik.toml | ||
backend: | ||
image: gaetancollaud/bar-o-matic-backend | ||
container_name: baromatic-backend | ||
build: ./backend | ||
#links: | ||
# - mongodb:mongodb | ||
#TODO add devices | ||
labels: | ||
- "traefik.frontend.rule=PathPrefix:/api" | ||
- "traefik.enable=true" | ||
- "traefik.port=8080" | ||
frontend: | ||
image: gaetancollaud/bar-o-matic-frontend | ||
container_name: baromatic-frontend | ||
build: ./frontend | ||
labels: | ||
- "traefik.frontend.rule=PathPrefix:/" | ||
- "traefik.enable=true" | ||
- "traefik.port=80" | ||
mongodb: | ||
image: mongo | ||
container_name: cocktail-mongo | ||
user: root | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- "./data/mongo:/data/db" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM nginx:alpine | ||
|
||
# install curl | ||
RUN apk add --no-cache curl | ||
|
||
# create health check | ||
HEALTHCHECK --interval=5s --timeout=2s CMD curl --fail -A "docker-healthcheck-curl/1.0.0" http://localhost:80/ || exit 1 | ||
|
||
# Configure for angular fallback routes | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Copy built app to wwwroot | ||
COPY dist /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
events { | ||
# events context | ||
} | ||
|
||
http{ | ||
include /etc/nginx/mime.types; | ||
|
||
server { | ||
listen 80 default_server; | ||
access_log /var/log/nginx.access.log; | ||
error_log /var/log/nginx.error.log; | ||
root /usr/share/nginx/html; | ||
charset utf-8; | ||
|
||
add_header X-Frame-Options "SAMEORIGIN"; | ||
|
||
location / { | ||
try_files $uri /index.html; | ||
} | ||
} | ||
} |
Oops, something went wrong.