Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
natew committed Jan 27, 2025
1 parent 56e1a4d commit 6612762
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 48 deletions.
7 changes: 7 additions & 0 deletions apps/chat/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# note we want dist

node_modules
ios
android
.git
.sst
7 changes: 3 additions & 4 deletions apps/chat/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -13,11 +15,8 @@ COPY . .
RUN corepack enable
RUN corepack prepare [email protected] --activate
RUN yarn install --immutable
RUN yarn profile react-19
RUN yarn build:js

WORKDIR /app/apps/chat
RUN yarn build:web

EXPOSE 3000

Expand Down
10 changes: 9 additions & 1 deletion apps/chat/src/ci/buildDockerImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`])
Expand Down
12 changes: 0 additions & 12 deletions apps/chat/src/postgres/sst-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
12 changes: 0 additions & 12 deletions apps/chat/src/zero/sst-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
12 changes: 0 additions & 12 deletions apps/chat/sst-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 11 additions & 7 deletions scripts/yarn-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 6612762

Please sign in to comment.