Skip to content

Commit

Permalink
deploy retry
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonSmith committed Aug 7, 2024
1 parent 8b38d7f commit 5721143
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ jobs:
--project=${{ vars.GCP_PROJECT_ID }} \
--image=${{ steps.meta.outputs.tags }} \
--platform=managed \
--port=4000 \
--region=us-central1 \
--allow-unauthenticated \
--update-env-vars=NEXT_PUBLIC_API_HOSTNAME=${{ secrets.NEXT_PUBLIC_API_HOSTNAME }} \
--update-env-vars=NEXT_PUBLIC_API_HOSTNAME=${{ secrets.NEXT_PUBLIC_API_HOSTNAME }},NODE_ENV=production \
--memory=4Gi \
--cpu=4 \
--max-instances=1
3 changes: 1 addition & 2 deletions .github/workflows/docker_push_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ jobs:

- name: Build Docker image
run: |
docker build -t ${{ env.IMAGE_NAME }} -f ./src/interfaces/coral_web/Dockerfile ./src/interfaces/coral_web/
docker build -t ${{ env.IMAGE_NAME }} -f ./src/interfaces/coral_web/Dockerfile --build-arg NODE_ENV=production ./src/interfaces/coral_web/
- name: Tag Docker image
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ steps.meta.outputs.tags }}
Expand Down
21 changes: 17 additions & 4 deletions src/interfaces/coral_web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ COPY tailwind.config.js .
COPY postcss.config.js .
COPY .en[v] .env

# Build the Next.js app
ARG NODE_ENV=development
RUN if [ "$NODE_ENV" = "production" ]; then npm run build; else npm run build:dev; fi


# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry
# Uncomment the following line to disable telemetry at run time
# ENV NEXT_TELEMETRY_DISABLED 1
Expand All @@ -28,8 +33,16 @@ COPY .en[v] .env

# Start Next.js in development mode based on the preferred package manager
CMD \
if [ -f yarn.lock ]; then yarn dev; \
elif [ -f package-lock.json ]; then npm run dev; \
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \
else npm run dev; \
if [ "$NODE_ENV" = "production" ]; then \
if [ -f yarn.lock ]; then yarn start; \
elif [ -f package-lock.json ]; then npm start:prod; \
elif [ -f pnpm-lock.yaml ]; then pnpm start:prod; \
else npm start:prod; \
fi; \
else \
if [ -f yarn.lock ]; then yarn dev; \
elif [ -f package-lock.json ]; then npm run dev; \
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \
else npm run dev; \
fi; \
fi
4 changes: 3 additions & 1 deletion src/interfaces/coral_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"start": "next start",
"start:single-docker": "next start --port 4000",
"start:single-docker-proxy": "next start --port 8090",
"generate:client": "openapi --input http://0.0.0.0:8000/openapi.json --output ./src/cohere-client/generated --client axios --useOptions"
"generate:client": "openapi --input http://0.0.0.0:8000/openapi.json --output ./src/cohere-client/generated --client axios --useOptions",
"build:prod": "env-cmd -f ./.env.production next build",
"start:prod": "next start"
},
"dependencies": {
"@babel/core": "^7.23.3",
Expand Down

0 comments on commit 5721143

Please sign in to comment.