aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-03-21 21:58:11 +0000
committerterminaldweller <thabogre@gmail.com>2022-03-21 21:58:11 +0000
commitf084c45b544b7c3c47d0638081f05ebce3ea1e42 (patch)
treed7ffdbcabacbe8c5262e28f047f9b272d0edea5f
parentwip (diff)
downloadmdrtl-f084c45b544b7c3c47d0638081f05ebce3ea1e42.tar.gz
mdrtl-f084c45b544b7c3c47d0638081f05ebce3ea1e42.zip
wip
-rw-r--r--spring-front/Dockerfile10
-rw-r--r--spring-front/nginx.conf5
-rw-r--r--spring-front/src/index.css0
-rw-r--r--spring-front/src/index.html23
-rw-r--r--spring-front/src/index.js17
-rw-r--r--spring-front/src/index.jsx20
6 files changed, 20 insertions, 55 deletions
diff --git a/spring-front/Dockerfile b/spring-front/Dockerfile
index c4d0b14..9993468 100644
--- a/spring-front/Dockerfile
+++ b/spring-front/Dockerfile
@@ -1,3 +1,8 @@
+FROM node:lts-alpine3.13 as certbuilder
+RUN apk add openssl
+WORKDIR /certs
+RUN openssl req -nodes -new -x509 -subj="/C=US/ST=Denial/L=springfield/O=Dis/CN=localhost" -keyout server.key -out server.cert
+
FROM node:16.14.2-alpine as builder
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
@@ -8,11 +13,6 @@ RUN npm install react-scripts -g
COPY . ./
RUN npm run build
-FROM node:lts-alpine3.13 as certbuilder
-RUN apk add openssl
-WORKDIR /certs
-RUN openssl req -nodes -new -x509 -subj="/C=US/ST=Denial/L=springfield/O=Dis/CN=localhost" -keyout server.key -out server.cert
-
FROM nginx:stable-alpine
COPY --from=builder /app/build /usr/share/nginx/html
COPY --from=certbuilder /certs /certs
diff --git a/spring-front/nginx.conf b/spring-front/nginx.conf
index e726512..197ba1f 100644
--- a/spring-front/nginx.conf
+++ b/spring-front/nginx.conf
@@ -2,8 +2,9 @@ events {
worker_connections 1024;
}
http {
+ include mime.types;
server {
- listen 443 ssl;
+ listen 443 ssl http2;
keepalive_timeout 70;
ssl_certificate /certs/server.cert;
ssl_certificate_key /certs/server.key;
@@ -13,6 +14,8 @@ http {
tcp_nopush on;
location / {
root /usr/share/nginx/html;
+ index index.html;
+ try_files $uri $uri/ /index.html;
}
}
}
diff --git a/spring-front/src/index.css b/spring-front/src/index.css
deleted file mode 100644
index e69de29..0000000
--- a/spring-front/src/index.css
+++ /dev/null
diff --git a/spring-front/src/index.html b/spring-front/src/index.html
deleted file mode 100644
index d82108b..0000000
--- a/spring-front/src/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <script
- crossorigin
- src="https://unpkg.com/react@17/umd/react.production.min.js"
- ></script>
- <script
- crossorigin
- src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"
- ></script>
- <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
- <link rel="stylesheet" href="index.css" />
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width" />
- <title></title>
- link
- </head>
- <body>
- <div id="root"></div>
- <script src="index.js" type="text/babel"></script>
- </body>
-</html>
diff --git a/spring-front/src/index.js b/spring-front/src/index.js
index 81d4809..d62147c 100644
--- a/spring-front/src/index.js
+++ b/spring-front/src/index.js
@@ -1,9 +1,14 @@
import React from "react";
+import ReactDOM from "react-dom";
-const page = (
- <div>
- <h1>Hello, everyone!</h1>
- <p>A paragraph</p>
- </div>
+const navbar = (
+ <nav>
+ <h1>terminaldweller.com</h1>
+ <ul>
+ <li>Pricing</li>
+ <li>About</li>
+ <li>Contact</li>
+ </ul>
+ </nav>
);
-React.ReactDOM.render(page, document.getElementById("root"));
+ReactDOM.render(navbar, document.getElementById("root"));
diff --git a/spring-front/src/index.jsx b/spring-front/src/index.jsx
deleted file mode 100644
index 0ef0cdf..0000000
--- a/spring-front/src/index.jsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from "react";
-
-const page = (
- <div>
- <h1>Hello, everyone!</h1>
- <p>A paragraph</p>
- </div>
-);
-
-const navbar = (
- <nav>
- <h1>terminaldweller.com</h1>
- <ul>
- <li>Pricing</li>
- <li>About</li>
- <li>Contact</li>
- </ul>
- </nav>
-)
-React.ReactDOM.render(navbar, document.getElementById("root"));