From 6e267bbd8137a3561ef7ca18557c264c801511c7 Mon Sep 17 00:00:00 2001
From: rlacko <rlacko@sch.bme.hu>
Date: Sat, 8 Feb 2020 04:23:16 +0100
Subject: [PATCH] production fixes

---
 Dockerfile                           | 9 ++++-----
 package.json                         | 5 ++---
 public/index.html                    | 2 +-
 src/components/forms/AddEventForm.js | 4 ++--
 src/components/forms/ConfirmModal.js | 1 -
 src/setupProxy.js                    | 6 ------
 6 files changed, 9 insertions(+), 18 deletions(-)
 delete mode 100644 src/setupProxy.js

diff --git a/Dockerfile b/Dockerfile
index a9229aa..0b38c20 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,12 +10,11 @@ COPY ./public ./public
 COPY package.json yarn.lock package-lock.json ./
 
 # Installing dependencies
-RUN npm install
-
-# Building the application
-RUN npm run build
+RUN npm install 
+RUN npm install serve
+RUN yarn build
 
 # Running
 EXPOSE 3000
-ENTRYPOINT ["npm", "run", "start"]
+ENTRYPOINT ["npm", "run", "deploy"]
 
diff --git a/package.json b/package.json
index a7cbdc2..39b1116 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,10 @@
 {
   "name": "kszkepzes-frontend",
   "version": "0.2.0",
-  "proxy": "http://127.0.0.1:8000/",
   "private": false,
   "dependencies": {
     "axios": "^0.19.2",
     "eslint-plugin-flowtype": "^4.6.0",
-    "http-proxy-middleware": "^0.20.0",
     "moment": "^2.24.0",
     "npm": "^6.13.7",
     "prop-types": "^15.7.2",
@@ -29,7 +27,8 @@
     "start": "react-scripts start",
     "build": "react-scripts build",
     "test": "react-scripts test --env=jsdom",
-    "eject": "react-scripts eject"
+    "eject": "react-scripts eject",
+    "deploy": "serve -l 3000 -s build"
   },
   "devDependencies": {
     "eslint": "6.8.0",
diff --git a/public/index.html b/public/index.html
index e1b4c45..ac92f4c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="en">
+<html lang="hu">
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
diff --git a/src/components/forms/AddEventForm.js b/src/components/forms/AddEventForm.js
index a9dd5d9..0bfb971 100644
--- a/src/components/forms/AddEventForm.js
+++ b/src/components/forms/AddEventForm.js
@@ -1,5 +1,5 @@
 import React, { Component } from 'react';
-import { Modal, Button, Form, Input, TextArea, Icon } from 'semantic-ui-react';
+import { Modal, Button, Form, Input, Icon } from 'semantic-ui-react';
 import { connect } from 'react-redux';
 import { DateTimeInput } from 'semantic-ui-calendar-react';
 import { writeEvent, eventDate, addEvent } from '../../actions/statistics'
@@ -25,7 +25,7 @@ class AddEventForm extends Component {
   }
 
   render() {
-    const { name, date, description } = this.props.newEvent;
+    const { name, description } = this.props.newEvent;
     return (
       <Modal
         open={this.state.showModal}
diff --git a/src/components/forms/ConfirmModal.js b/src/components/forms/ConfirmModal.js
index 3998252..91a68e2 100644
--- a/src/components/forms/ConfirmModal.js
+++ b/src/components/forms/ConfirmModal.js
@@ -37,7 +37,6 @@ class ConfirmModal extends Component {
             basic
             color='red'
             inverted
-            inverted
             onClick={() => this.close()}
           >
             <Icon name='remove' /> Nem
diff --git a/src/setupProxy.js b/src/setupProxy.js
deleted file mode 100644
index 539efe3..0000000
--- a/src/setupProxy.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const proxy = require('http-proxy-middleware');
-
-module.exports = function(app) {
-  app.use(proxy('/api', { target: 'http://127.0.0.1:8000/' }))
-  app.use(proxy('/media', { target: 'http://127.0.0.1:8000/' }))
-};
-- 
GitLab