From 2f665e34849af50b585d5216915e4961528047f8 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 14 Jul 2025 17:42:00 -0500 Subject: [PATCH] added turborepo and working on Docker setup --- .gitignore | 3 +- Dockerfile | 36 ++++++++++++++++++++++++ apps/lightsaver_user_client/package.json | 2 +- package.json | 2 +- pnpm-workspace.yaml | 11 ++++++-- 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index c4d504e..0f2afd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -.turbo \ No newline at end of file +.turbo +out \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2470a39 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# 1. Build stage +FROM node:22-slim AS builder + +ENV NVM_DIR=/root/.nvm +ENV NODE_VERSION=22 + +# Install dependencies for Node +RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y ca-certificates build-essential + +# Enable corepack and prepare pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate + +WORKDIR /app + +COPY . . + +RUN rm -rf node_modules pnpm-lock.yaml +RUN yes | pnpm install + +RUN pnpm turbo run build --filter=lightsaver_user_client... + +#debugging +RUN ls -al /app/apps/lightsaver_user_client + +# 2. Production stage +FROM node:22-slim + +# Enable corepack and prepare pnpm + +WORKDIR /app + +COPY --from=builder /app/apps/lightsaver_user_client ./ +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/packages ./packages + +EXPOSE 3000 \ No newline at end of file diff --git a/apps/lightsaver_user_client/package.json b/apps/lightsaver_user_client/package.json index 4dc6093..2ec7285 100644 --- a/apps/lightsaver_user_client/package.json +++ b/apps/lightsaver_user_client/package.json @@ -1,5 +1,5 @@ { - "name": "web", + "name": "lightsaver_user_client", "version": "0.1.0", "private": true, "scripts": { diff --git a/package.json b/package.json index f89db5f..9bab91e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "build": "turbo build", + "build": "turbo run build", "check-types": "tsc --noEmit", "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6f8f53f..b9c3ad5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,9 @@ packages: - - "apps/*" - - "services/*" - - "packages/*" \ No newline at end of file + - apps/* + - services/* + - packages/* + +onlyBuiltDependencies: + - '@tailwindcss/oxide' + - sharp + - unrs-resolver