mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 03:34:35 +00:00
fix(docker): docker-compose for prod+development
This commit is contained in:
@@ -1 +1,2 @@
|
||||
REACT_APP_PORT_API=[place sasjs server port]
|
||||
REACT_APP_CLIENT_ID=<place clientId here>
|
||||
@@ -3,7 +3,6 @@ WORKDIR /usr/server/web
|
||||
COPY ["package.json","package-lock.json", "./"]
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
EXPOSE 3000
|
||||
# RUN chown -R node /usr/server/api
|
||||
# USER node
|
||||
CMD ["npm","start"]
|
||||
|
||||
@@ -7,8 +7,12 @@ const headers = {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
const { NODE_ENV, REACT_APP_PORT_API } = process.env
|
||||
const baseUrl =
|
||||
process.env.NODE_ENV === 'development' ? 'http://localhost:5000' : undefined
|
||||
NODE_ENV === 'development'
|
||||
? `http://localhost:${REACT_APP_PORT_API ?? 5000}`
|
||||
: ''
|
||||
|
||||
const getAuthCode = async (credentials: any) => {
|
||||
return fetch(`${baseUrl}/SASjsApi/auth/authorize`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -43,8 +43,11 @@ export default function useTokens() {
|
||||
}
|
||||
}
|
||||
|
||||
const { NODE_ENV, REACT_APP_PORT_API } = process.env
|
||||
const baseUrl =
|
||||
process.env.NODE_ENV === 'development' ? 'http://localhost:5000' : undefined
|
||||
NODE_ENV === 'development'
|
||||
? `http://localhost:${REACT_APP_PORT_API ?? 5000}`
|
||||
: ''
|
||||
|
||||
const isAbsoluteURLRegex = /^(?:\w+:)\/\//
|
||||
|
||||
|
||||
Reference in New Issue
Block a user