Improve documentation.

This commit is contained in:
Paulo Gustavo Veiga
2024-04-06 02:47:01 -07:00
parent 12b46b4400
commit b510e4929e
7 changed files with 58 additions and 182 deletions

View File

@@ -3,21 +3,17 @@ FROM node:18.12.1-buster-slim AS builder
# Set the working directory in the container
WORKDIR /app
ARG VERSION="5.1.2"
ARG VERSION="6.0.1"
## Install dependencies
# 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:latest
LABEL maintainer="Paulo Gustavo Veiga <pveiga@wisemapping.com>"
## Copy the built React app to Nginx's web server directory
COPY --from=builder /app/index.html /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/
COPY --from=builder /app/webapp/package/dist/* /usr/share/nginx/html/
ADD nginx.conf .
COPY nginx.conf /etc/nginx/conf.d/default.conf

View File

@@ -1,52 +0,0 @@
<!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>

View File

@@ -3,6 +3,8 @@ server {
gzip on;
charset UTF-8;
server_name wise-ui;
# Change base URL to match the host URL.
sub_filter '<base>' '<base href="http://$host/">';
location / {
# This would be the directory where your React app's static files are stored at
@@ -18,7 +20,7 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8080/api/;
proxy_pass http://wise-api:8080/api/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;

View File

@@ -1,63 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.wisemapping</groupId>
<artifactId>wise-ui</artifactId>
<packaging>war</packaging>
<name>WiseMapping Frontend</name>
<parent>
<groupId>org.wisemapping</groupId>
<artifactId>wisemapping</artifactId>
<relativePath>../pom.xml</relativePath>
<version>5.1.0-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<!-- Download and unzip mindplot npm package -->
<mkdir dir="target/wisemapping-mindplot"/>
<exec executable="npm" dir="target" failonerror="true">
<arg value="pack"/>
<arg value="@wisemapping/mindplot@5.1.2"/>
</exec>
<exec executable="tar" dir="target" failonerror="true">
<arg value="-xvzf"/>
<arg value="wisemapping-mindplot-5.1.2.tgz"/>
<arg value="-C"/>
<arg value="wisemapping-mindplot"/>
</exec>
<!-- Download and unzip webapp npm package -->
<mkdir dir="target/wisemapping-webapp"/>
<exec executable="npm" dir="target" failonerror="true">
<arg value="pack"/>
<arg value="@wisemapping/webapp@5.1.2"/>
</exec>
<exec executable="tar" dir="target" failonerror="true">
<arg value="-xvzf"/>
<arg value="wisemapping-webapp-5.1.2.tgz"/>
<arg value="-C"/>
<arg value="wisemapping-webapp"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>