Docker -> ready to work on remote

feature/2_forms
TBS093A 2021-05-17 21:18:27 +02:00
parent 37f7f6448e
commit 9e2efb8d06
5 changed files with 7 additions and 26 deletions

View File

@ -1,3 +1,2 @@
node_modules/ node_modules/
.cache/
public/ public/

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
node_modules/ node_modules/
.cache/ .cache/
public public/

View File

@ -10,28 +10,10 @@ COPY package.json ./
COPY package-lock.json ./ COPY package-lock.json ./
RUN npm install --silent RUN npm install --silent
RUN npm install gatsby-cli --silent
ENV GATSBY_TELEMETRY_DISABLED=1
# add app # add app
COPY . ./ COPY . ./
CMD ["npm", "build"]
# start app
CMD ["npm", "start"]
# FROM node:14.4.0
# WORKDIR /usr/src/app
# COPY package*.json ./
# RUN npm install
# COPY . .
# RUN npm install -g gatsby-cli
# CMD ['gatsby', 'develop', '-H', '0.0.0.0:8000']

View File

@ -1,3 +1,3 @@
let API = 'localhost:9090' let API = '0.0.0.0:9090'
export const GeneralAddress = 'http://' + API export const GeneralAddress = 'http://' + API
export const GeneralAddressWS = 'ws://' + API + '/render' export const GeneralAddressWS = 'ws://' + API + '/render'

View File

@ -80,7 +80,7 @@ const headerBuilder = (url, method, token, body) => {
'authorization': token, 'authorization': token,
'x-csrftoken': getCookie('csrftoken'), 'x-csrftoken': getCookie('csrftoken'),
'accept': 'application/json', 'accept': 'application/json',
'content-type': 'application/json', 'content-type': 'application/json'
} }
let headers = { let headers = {
url: url, url: url,
@ -90,7 +90,7 @@ const headerBuilder = (url, method, token, body) => {
} }
if (method === 'PUT' || method === 'POST' || method === 'PATCH') { if (method === 'PUT' || method === 'POST' || method === 'PATCH') {
headers = Object.assign({}, headers, { headers = Object.assign({}, headers, {
data: JSON.stringify(body), data: JSON.stringify(body)
}) })
} }
return headers return headers