Start docker compoose.
This commit is contained in:
26
wise-ui/Dockerfile
Normal file
26
wise-ui/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM node:18.12.1-buster-slim AS builder
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
ARG VERSION="5.1.2"
|
||||
|
||||
## Install dependencies
|
||||
RUN mkdir webapp && npm pack @wisemapping/webapp@${VERSION} && tar -xvzf wisemapping-webapp-${VERSION}.tgz -C webapp
|
||||
RUN mkdir mindplot && npm pack @wisemapping/mindplot@${VERSION} && tar -xvzf wisemapping-mindplot-${VERSION}.tgz -C mindplot
|
||||
ADD index.html .
|
||||
|
||||
# Use Nginx as the production server
|
||||
FROM nginx:stable-alpine
|
||||
LABEL maintainer="Paulo Gustavo Veiga <pveiga@wisemapping.com>"
|
||||
|
||||
## Copy the built React app to Nginx's web server directory
|
||||
COPY --from=builder /app /usr/share/nginx/html
|
||||
COPY --from=builder /app/webapp/package/dist/* /usr/share/nginx/html/webapp/
|
||||
COPY --from=builder /app/mindplot/package/dist/* /usr/share/nginx/html/mindplot/
|
||||
|
||||
# Expose port 80 for the Nginx server
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx when the container runs
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
52
wise-ui/index.html
Normal file
52
wise-ui/index.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<base href="/static/webapp/"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;600&display=swap"
|
||||
as="style" onload="this.onload=null;this.rel='stylesheet'" crossorigin>
|
||||
<script>
|
||||
window.serverconfig = {
|
||||
apiBaseUrl: '${requestScope['site.baseurl']}',
|
||||
analyticsAccount: '${requestScope['google.analytics.account']}',
|
||||
clientType: 'rest',
|
||||
recaptcha2Enabled: ${requestScope['google.recaptcha2.enabled']},
|
||||
recaptcha2SiteKey: '${requestScope['google.recaptcha2.siteKey']}',
|
||||
googleOauth2Url: '${requestScope['security.oauth2.google.url']}'
|
||||
};
|
||||
|
||||
<%-- Hack to force view selection on react to move all the UI to react --%>
|
||||
window.errorMvcView = '${requestScope['exception']!=null?(fn:indexOf(requestScope['exception'],'SecurityException') gt 1?'securityError':'unexpectedError'):''}';
|
||||
/*
|
||||
${requestScope['exception']}
|
||||
*/
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function downloadJsAtOnload() {
|
||||
setTimeout(function downloadJs() {
|
||||
var element = document.createElement("script");
|
||||
element.setAttribute("data-ad-client", "ca-pub-4996113942657337");
|
||||
element.async = true;
|
||||
element.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
|
||||
document.body.appendChild(element);
|
||||
}, 50);
|
||||
};
|
||||
|
||||
window.addEventListener("load", downloadJsAtOnload, false);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="text/javascript" src="/webapp/vendors.bundle.js" crossorigin="anonymous" async></script>
|
||||
<script type="text/javascript" src="/webapp/app.bundle.js" crossorigin="anonymous" async></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -58,21 +58,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<webResources>
|
||||
<resource>
|
||||
<directory>target</directory>
|
||||
<!-- this is relative to the pom.xml directory -->
|
||||
<includes>wisemapping-*/**/dist/*</includes>
|
||||
</resource>
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
Reference in New Issue
Block a user