Permalink
Browse files

Add frontend and docker-compose template

  • Loading branch information...
schrieveslaach committed Nov 30, 2018
1 parent 9e66f9a commit 22d4d4f046c414fed87e3b7234d83b60bf5d247b
@@ -0,0 +1,29 @@
version: "3"

services:
api:
image: aixigo/prevant-api
network_mode: "bridge"
userns_mode: "host"
labels:
traefik.frontend.rule: 'ReplacePathRegex: ^/api(.*) /$$1;PathPrefix:/api;'
volumes:
- /var/run/docker.sock:/var/run/docker.sock

frontend:
image: aixigo/prevant-frontend
network_mode: "bridge"
labels:
traefik.frontend.rule: 'PathPrefix:/;'
traefik.frontend.priority: -100

traefik:
image: traefik
command: --api --docker
network_mode: "bridge"
userns_mode: "host"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@@ -0,0 +1,11 @@
FROM docker.io/library/node:10-alpine as frontend-builder
WORKDIR /usr/src/apps/
COPY . .
RUN npm install && npm run build

FROM docker.io/library/nginx:1.15-alpine
LABEL maintainer="marc.schreiber@aixigo.de"

COPY --from=frontend-builder /usr/src/apps/dist/* /usr/share/nginx/html/dist/
COPY index.html favicon.svg /usr/share/nginx/html/

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 6.3499999 6.3499998"
version="1.1"
id="svg1140"
inkscape:version="0.92.1 r15371"
sodipodi:docname="favicon.svg">
<defs
id="defs1134" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="24.173684"
inkscape:cy="-16.633612"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="1"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="1"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1136"
inkscape:window-x="1920"
inkscape:window-y="30"
inkscape:window-maximized="1" />
<metadata
id="metadata1137">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(381.23321,-343.42387)">
<rect
style="display:inline;opacity:0.2;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.52916664;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="rect4592"
width="5.2916665"
height="5.5562501"
x="-380.70404"
y="343.95303"
rx="0.26458332"
ry="0.26458332" />
<g
style="display:inline;enable-background:new"
id="g4576"
transform="matrix(0.26458333,0,0,0.26458333,-395.25613,274.6322)">
<rect
transform="matrix(0,-1,-1,0,0,0)"
style="fill:#78909c;fill-opacity:1;stroke:none"
id="rect4465"
width="7"
height="19.999985"
x="-268"
y="-75"
rx="1"
ry="1" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#455a64;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 63.004293,263.49429 -1.5,2"
id="path4487"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path4489"
d="m 61.004293,263.49429 -1.5,2"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#455a64;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#455a64;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 59.004293,263.49429 -1.5,2"
id="path4491"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:connector-curvature="0"
id="rect4541"
d="m 56,261 c -0.554,0 -1,0.446 -1,1 v 1 c 0,-0.554 0.446,-1 1,-1 h 18 c 0.554,0 1,0.446 1,1 v -1 c 0,-0.554 -0.446,-1 -1,-1 z"
style="opacity:0.2;fill:#ffffff;fill-opacity:1;stroke:none" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:connector-curvature="0"
style="opacity:0.2;fill:#000000;fill-opacity:1;stroke:none"
d="m 56,268 c -0.554,0 -1,-0.446 -1,-1 v -1 c 0,0.554 0.446,1 1,1 h 18 c 0.554,0 1,-0.446 1,-1 v 1 c 0,0.554 -0.446,1 -1,1 z"
id="path4546" />
<rect
style="opacity:1;fill:#76ff03;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4562"
width="1"
height="1"
x="68"
y="264" />
<rect
y="264"
x="70"
height="1"
width="1"
id="rect4564"
style="opacity:1;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:1;fill:#ffcd40;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4566"
width="1"
height="1"
x="72"
y="264" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path4574"
d="m 65.004293,263.49429 -1.5,2"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#455a64;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<use
style="display:inline;enable-background:new"
x="0"
y="0"
xlink:href="#g4576"
id="use4588"
transform="translate(-1.9975168e-7,1.8520831)"
width="100%"
height="100%" />
<use
style="display:inline;enable-background:new"
height="100%"
width="100%"
transform="translate(-1.9975168e-7,3.7041671)"
id="use4590"
xlink:href="#g4576"
y="0"
x="0" />
</g>
</svg>
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet"
href="https://unpkg.com/bootstrap-material-design@4.1.1/dist/css/bootstrap-material-design.min.css"
integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX" crossorigin="anonymous">
<link rel="stylesheet"
href="dist/init.css">

<link rel="icon" type="image/svg+xml" href="favicon.svg" sizes="any">

<title>PREvant</title>
</head>
<body>

<nav id="nav"></nav>

<div id="app"></div>
<script src="dist/app.js" type="text/javascript"></script>

<script
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script
src="https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js"
integrity="sha384-fA23ZRQ3G/J53mElWqVJEGJzU0sTs+SvzG8fXVWP+kJQ1lwFAOkcUOysnlKJC33U"
crossorigin="anonymous"></script>
<script
src="https://unpkg.com/bootstrap-material-design@4.1.1/dist/js/bootstrap-material-design.js"
integrity="sha384-CauSuKpEqAFajSpkdjv3z9t8E7RlpJ1UP0lKM/+NdtSarroVKu069AlsRPKkFBz9"
crossorigin="anonymous"></script>
<script type="text/javascript">
$( document ).ready( () => {
$( 'body' ).bootstrapMaterialDesign();
} );
</script>
</body>
</html>
@@ -0,0 +1,49 @@
{
"name": "preview-servant-frontend",
"version": "0.9.0",
"license": "MIT",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.3.1",
"@fortawesome/fontawesome-svg-core": "^1.2.4",
"@fortawesome/free-solid-svg-icons": "^5.3.1",
"@fortawesome/vue-fontawesome": "^0.1.1",
"isomorphic-fetch": "^2.2.1",
"mdn-polyfills": "^5.12.0",
"moment": "^2.22.2",
"v-tooltip": "^2.0.0-rc.33",
"vue": "^2.5.17",
"vue-resource": "^1.5.1",
"vuex": "^3.0.1"
},
"browserslist": [
"ie >= 11",
"Firefox >= 60",
"Firefox ESR",
"Chrome >= 60"
],
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"autoprefixer": "^9.1.5",
"babel-loader": "^8.0.4",
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"file-loader": "^1.1.4",
"mini-css-extract-plugin": "^0.4.1",
"node-sass": "^4.9.2",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
"vue-loader": "^15.2.6",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.16.1",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.4",
"webpack-notifier": "^1.6.0"
}
}
@@ -0,0 +1,23 @@
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.aixigo.preview.servant</groupId>
<artifactId>parent</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>frontend</artifactId>
<name>PREvant Frontend</name>

<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
@@ -0,0 +1,8 @@
module.exports = {
plugins: [
require( 'autoprefixer' )( {
grid: true,
browsers: [ 'ie >= 11', 'Firefox >= 60', 'Firefox ESR', 'Chrome >= 60' ]
} )
]
};
Oops, something went wrong.

0 comments on commit 22d4d4f

Please sign in to comment.