Use cerc/webapp-base as Docker base image.
This commit is contained in:
parent
ac26f6f46d
commit
0acc9d1524
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM node:18-alpine3.15 as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN rm -rf node_modules && rm -rf build && yarn install
|
||||
RUN yarn build
|
||||
|
||||
FROM cerc/webapp-base:local
|
||||
|
||||
COPY config.yml /config
|
||||
RUN mkdir -p /data
|
||||
COPY --from=builder /app/build /data
|
4
config.yml
Normal file
4
config.yml
Normal file
@ -0,0 +1,4 @@
|
||||
web:
|
||||
path: ''
|
||||
api:
|
||||
url: 'http://localhost:9393'
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "react-login-page",
|
||||
"version": "0.1.0",
|
||||
"homepage": "/newuser/",
|
||||
"private": true,
|
||||
"homepage": "LACONIC_HOSTED_CONFIG_web_path",
|
||||
"dependencies": {
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.8.6",
|
||||
@ -11,7 +11,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"clean": "rm -rf build",
|
||||
"build": "NODE_OPTIONS=--openssl-legacy-provider react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
|
@ -10,15 +10,13 @@ import HomePage from './components/pages/HomePage'
|
||||
import './App.css'
|
||||
|
||||
export default function App() {
|
||||
const basePath = "LACONIC_HOSTED_CONFIG_web_path"
|
||||
return (
|
||||
<Router>
|
||||
<div>
|
||||
<Switch>
|
||||
<Route exact path="/newuser/" component={ RegisterPage } />
|
||||
{/*<Route path="/login" component={ LoginPage } />*/}
|
||||
<Route path="/newuser/register" component={ RegisterPage } />
|
||||
{/*<Route path="/forget-password" component={ ForgetPasswordPage } />*/}
|
||||
{/*<Route path="/home" component={ HomePage } />*/}
|
||||
<Route exact path={basePath} component={ RegisterPage } />
|
||||
<Route path={basePath + "/register"} component={ RegisterPage } />
|
||||
</Switch>
|
||||
<Footer />
|
||||
</div>
|
||||
|
@ -9,9 +9,10 @@ export default function SignUpPage() {
|
||||
const [message, setMessage] = useState("");
|
||||
|
||||
let handleSubmit = async (e) => {
|
||||
const apiBase = "LACONIC_HOSTED_CONFIG_api_url";
|
||||
e.preventDefault();
|
||||
try {
|
||||
let res = await fetch("/register", {
|
||||
let res = await fetch(`${apiBase}/register`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@ -38,12 +39,12 @@ export default function SignUpPage() {
|
||||
{/*<h2>Join us</h2>*/}
|
||||
{/*<h5>Create your personal account</h5>*/}
|
||||
<form onSubmit={handleSubmit} action="">
|
||||
<p>
|
||||
<label>Username</label><br/>
|
||||
<input type="text" name="username"
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
required />
|
||||
</p>
|
||||
{/*<p>*/}
|
||||
{/* <label>Username</label><br/>*/}
|
||||
{/* <input type="text" name="username"*/}
|
||||
{/* onChange={(e) => setUsername(e.target.value)}*/}
|
||||
{/* required />*/}
|
||||
{/*</p>*/}
|
||||
<p>
|
||||
<label>Email address</label><br/>
|
||||
<input type="email" name="email"
|
||||
|
Loading…
Reference in New Issue
Block a user