mirror of
https://github.com/olehomelchenko/Mini-VLAT-ua.git
synced 2025-12-21 21:22:22 +00:00
prepare production dockerfiles and env
This commit is contained in:
1
ReactTool/frontend/.env
Normal file
1
ReactTool/frontend/.env
Normal file
@@ -0,0 +1 @@
|
||||
REACT_APP_API_URL=http://localhost:8000
|
||||
1
ReactTool/frontend/.env.production
Normal file
1
ReactTool/frontend/.env.production
Normal file
@@ -0,0 +1 @@
|
||||
REACT_APP_API_URL=https://mini-vlat-ua.duckdns.org/api
|
||||
14
ReactTool/frontend/Dockerfile.prod
Normal file
14
ReactTool/frontend/Dockerfile.prod
Normal file
@@ -0,0 +1,14 @@
|
||||
# ReactTool/frontend/Dockerfile.prod
|
||||
FROM node:16 as build
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
COPY yarn.lock ./
|
||||
|
||||
RUN yarn install
|
||||
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
@@ -31,7 +31,7 @@ class Tutorial extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
fetch('http://localhost:8000/new_session_id', {
|
||||
fetch(`${process.env.REACT_APP_API_URL}/new_session_id`, {
|
||||
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
||||
@@ -178,7 +178,7 @@ class VisQuiz extends Component {
|
||||
|
||||
on_survey_click() {
|
||||
|
||||
fetch('http://localhost:8000/record_responses_to_db', {
|
||||
fetch(`${process.env.REACT_APP_API_URL}//record_responses_to_db`, {
|
||||
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user