Skip to content

Commit 316cf52

Browse files
committed
build(ws): replace esbuild with tsc for building TypeScript
1 parent d8c0ba0 commit 316cf52

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/workflows/cd_frontend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
with:
2121
context: .
2222
file: ./docker/Dockerfile.frontend
23-
build-args:
24-
- DATABASE_URL=${{ secrets.DATABASE_URL }}
23+
build-args: |
24+
DATABASE_URL=${{ secrets.DATABASE_URL }}
2525
push: true
2626
tags: coderomm/collabydraw:${{ github.sha }}
2727
## Step to deploy this to a VM

apps/ws/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"main": "index.js",
55
"scripts": {
6-
"build": "npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --tsconfig=tsconfig.json",
6+
"build": "npx tsc -b",
77
"start": "node dist/index.js",
88
"dev": "pnpm run build && pnpm run start"
99
},

docker/Dockerfile.frontend

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@ WORKDIR /usr/src/app
77

88
# Add ARG for DATABASE_URL
99
ARG DATABASE_URL
10-
ENV DATABASE_URL=${DATABASE_URL}
10+
# ENV DATABASE_URL=${DATABASE_URL}
1111

1212
# Copy necessary files for dependency installation
1313
COPY ./packages ./packages
1414
COPY ./package.json ./package.json
1515
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
16+
COPY ./pnpm-workspace.yaml ./pnpm-workspace.yaml
1617
COPY ./turbo.json ./turbo.json
17-
COPY ./apps/frontend ./apps/frontend
18+
COPY ./apps/collabydraw ./apps/collabydraw
19+
20+
# Install global Prisma CLI
21+
RUN npm install -g [email protected]
1822

1923
# Install dependencies
2024
RUN pnpm install --frozen-lockfile
2125

2226
# Generate database
23-
# add this "db:generate": "cd packages/db && bunx prisma generate && cd ../..",
24-
RUN pnpm run db:generate
27+
# RUN pnpm run db:generate
28+
29+
# Change to the packages/db directory and generate Prisma client
30+
WORKDIR /usr/src/app/packages/db
31+
RUN prisma generate
32+
33+
# Change back to the root directory
34+
WORKDIR /usr/src/app
2535

2636
# Build the application with database URL
2737
RUN DATABASE_URL=${DATABASE_URL} pnpm run build

0 commit comments

Comments
 (0)