diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eea705e17..c244259b8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,6 +41,13 @@ workflows: region: $AWS_REGION repo: $AWS_ECR_REPO tag: $CIRCLE_SHA1 + extra-build-args: > + --build-arg REACT_APP_AUTH0_DOMAIN=$REACT_APP_AUTH0_DOMAIN + --build-arg REACT_APP_AUTH0_CLIENT_ID=$REACT_APP_AUTH0_CLIENT_ID + --build-arg REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL + --build-arg REACT_APP_AUTH0_AUDIENCE=$REACT_APP_AUTH0_AUDIENCE + --build-arg REACT_APP_API_URL=$REACT_APP_API_URL + - aws-ecs/deploy-service-update: name: deploy-server-canary requires: @@ -95,6 +102,8 @@ workflows: region: $AWS_REGION repo: $AWS_ECR_REPO_API tag: $CIRCLE_SHA1 + extra-build-args: > + --build-arg HASURA_GRAPHQL_JWT_SECRET=$HASURA_GRAPHQL_JWT_SECRET - aws-ecs/deploy-service-update: name: deploy-api-canary requires: diff --git a/infra/dev/.env.example b/infra/dev/.env.example index 93141f3716..62151ad1cd 100644 --- a/infra/dev/.env.example +++ b/infra/dev/.env.example @@ -1,6 +1,8 @@ HASURA_GRAPHQL_JWT_SECRET=REPLACE_ME HASURA_GRAPHQL_ADMIN_SECRET=hasura_secret + REACT_APP_AUTH0_DOMAIN=twenty-dev.eu.auth0.com REACT_APP_AUTH0_CLIENT_ID=REPLACE_ME REACT_APP_AUTH0_CALLBACK_URL=http://localhost:3001/auth/callback -REACT_APP_AUTH0_AUDIENCE=hasura-dev \ No newline at end of file +REACT_APP_AUTH0_AUDIENCE=hasura-dev +REACT_APP_API_URL=http://localhost:8080/v1/graphql \ No newline at end of file diff --git a/infra/prod/twenty-api/Dockerfile b/infra/prod/twenty-api/Dockerfile index 3da6192dda..ecf222c960 100644 --- a/infra/prod/twenty-api/Dockerfile +++ b/infra/prod/twenty-api/Dockerfile @@ -1,3 +1,6 @@ FROM hasura/graphql-engine:latest as api +ARG HASURA_GRAPHQL_JWT_SECRET +ENV HASURA_GRAPHQL_JWT_SECRET=${HASURA_GRAPHQL_JWT_SECRET} + CMD ["sh", "-c", "graphql-engine serve"] diff --git a/infra/prod/twenty-server/Dockerfile b/infra/prod/twenty-server/Dockerfile index 78356a21de..4ff0d65b18 100644 --- a/infra/prod/twenty-server/Dockerfile +++ b/infra/prod/twenty-server/Dockerfile @@ -1,5 +1,11 @@ FROM node:18-alpine as app +ARG REACT_APP_API_URL +ARG REACT_APP_AUTH0_DOMAIN +ARG REACT_APP_AUTH0_CLIENT_ID +ARG REACT_APP_AUTH0_CALLBACK_URL +ARG REACT_APP_AUTH0_AUDIENCE + WORKDIR /app COPY . .