chore: inject enviroment at the ./front deployment phase (#2174) (#2179)

* chore: inject enviroment at the deployment phase (#2174)

* Dockerfile CMD env.sh
* env.sh generates env-config.js file
* index.html imports env-config.js
* front/src/config/index.ts imports REACT_APP_SERVER_BASE_URL

* Upgrade Dockerfiles

* Add compute pg_database_url for render

* fix tests

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Ruslan
2023-10-22 17:36:36 +07:00
committed by GitHub
parent 1954ed5e3a
commit a5fe256d7e
15 changed files with 52 additions and 15 deletions

View File

@ -6,6 +6,7 @@ import { useRecoilState } from 'recoil';
import { tokenPairState } from '@/auth/states/tokenPairState';
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
import { AppPath } from '@/types/AppPath';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { ActivityTarget } from '~/generated/graphql';
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
import { useUpdateEffect } from '~/hooks/useUpdateEffect';
@ -23,7 +24,7 @@ export const useApolloFactory = () => {
const apolloClient = useMemo(() => {
apolloRef.current = new ApolloFactory({
uri: `${process.env.REACT_APP_SERVER_BASE_URL}/graphql`,
uri: `${REACT_APP_SERVER_BASE_URL}/graphql`,
cache: new InMemoryCache({
typePolicies: {
Activity: {