From 6612762e590821ad10632c037db789392e14f210 Mon Sep 17 00:00:00 2001 From: natew Date: Sun, 26 Jan 2025 14:05:28 -1000 Subject: [PATCH] --- apps/chat/.dockerignore | 7 +++++++ apps/chat/Dockerfile | 7 +++---- apps/chat/src/ci/buildDockerImage.ts | 10 +++++++++- apps/chat/src/postgres/sst-env.d.ts | 12 ------------ apps/chat/src/zero/sst-env.d.ts | 12 ------------ apps/chat/sst-env.d.ts | 12 ------------ scripts/yarn-profile.ts | 18 +++++++++++------- 7 files changed, 30 insertions(+), 48 deletions(-) create mode 100644 apps/chat/.dockerignore diff --git a/apps/chat/.dockerignore b/apps/chat/.dockerignore new file mode 100644 index 000000000..8d55a6229 --- /dev/null +++ b/apps/chat/.dockerignore @@ -0,0 +1,7 @@ +# note we want dist + +node_modules +ios +android +.git +.sst diff --git a/apps/chat/Dockerfile b/apps/chat/Dockerfile index 7a2bfe589..7c5b76867 100644 --- a/apps/chat/Dockerfile +++ b/apps/chat/Dockerfile @@ -1,6 +1,8 @@ # for chat app +# having a lot of trouble building it in docker itself, it freezes +# instead plan to just build it on ci/local and then use the built here -FROM --platform=linux/amd64 node:22.4 +FROM node:22.4 ARG ONE_SERVER_URL @@ -13,11 +15,8 @@ COPY . . RUN corepack enable RUN corepack prepare yarn@4.4.0 --activate RUN yarn install --immutable -RUN yarn profile react-19 -RUN yarn build:js WORKDIR /app/apps/chat -RUN yarn build:web EXPOSE 3000 diff --git a/apps/chat/src/ci/buildDockerImage.ts b/apps/chat/src/ci/buildDockerImage.ts index 8f57f018f..793d0cea7 100644 --- a/apps/chat/src/ci/buildDockerImage.ts +++ b/apps/chat/src/ci/buildDockerImage.ts @@ -16,7 +16,15 @@ export async function buildDockerImage({ await exec('docker', ['login', 'ghcr.io', '-u', githubActor, '-p', githubToken]) // build - await exec('docker', ['build', '-f', image, '-t', `${imageName}:${tag}`, context]) + await exec('docker', [ + 'build', + '--platform=linux/amd64', + '-f', + image, + '-t', + `${imageName}:${tag}`, + context, + ]) // push await exec('docker', ['push', `${imageName}:${tag}`]) diff --git a/apps/chat/src/postgres/sst-env.d.ts b/apps/chat/src/postgres/sst-env.d.ts index f11c1acd9..e973cf25d 100644 --- a/apps/chat/src/postgres/sst-env.d.ts +++ b/apps/chat/src/postgres/sst-env.d.ts @@ -6,17 +6,5 @@ import "sst" export {} declare module "sst" { export interface Resource { - "GITHUB_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "chat-app": { - "service": string - "type": "sst.aws.Service" - "url": string - } - "vpc": { - "type": "sst.aws.Vpc" - } } } diff --git a/apps/chat/src/zero/sst-env.d.ts b/apps/chat/src/zero/sst-env.d.ts index f11c1acd9..e973cf25d 100644 --- a/apps/chat/src/zero/sst-env.d.ts +++ b/apps/chat/src/zero/sst-env.d.ts @@ -6,17 +6,5 @@ import "sst" export {} declare module "sst" { export interface Resource { - "GITHUB_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "chat-app": { - "service": string - "type": "sst.aws.Service" - "url": string - } - "vpc": { - "type": "sst.aws.Vpc" - } } } diff --git a/apps/chat/sst-env.d.ts b/apps/chat/sst-env.d.ts index f11c1acd9..e973cf25d 100644 --- a/apps/chat/sst-env.d.ts +++ b/apps/chat/sst-env.d.ts @@ -6,17 +6,5 @@ import "sst" export {} declare module "sst" { export interface Resource { - "GITHUB_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "chat-app": { - "service": string - "type": "sst.aws.Service" - "url": string - } - "vpc": { - "type": "sst.aws.Vpc" - } } } diff --git a/scripts/yarn-profile.ts b/scripts/yarn-profile.ts index e39b777fa..f4feac9a7 100644 --- a/scripts/yarn-profile.ts +++ b/scripts/yarn-profile.ts @@ -54,13 +54,17 @@ const main = async (name: string) => { }) if (profile.applied) { - // clear things - exec( - 'git reset HEAD -- package.json && git checkout -- package.json && git reset HEAD -- yarn.lock && git checkout -- yarn.lock', - (error, stdout, stderr) => { - if (error) console.error(`err2`, error) - } - ) + try { + // clear things + exec( + 'git reset HEAD -- package.json && git checkout -- package.json && git reset HEAD -- yarn.lock && git checkout -- yarn.lock', + (error, stdout, stderr) => { + if (error) console.error(`err2`, error) + } + ) + } catch { + // not in git probably in ci + } } }