Closed mikekuzak closed 8 months ago
Think the Dockerfile needs to be rewritten to support the change of pnpm
Yes thats correct, I think the docker file needs to be updates to pnpm and also adapted to the new turbo repo structure.
In order to build the project I'm adding
npm i
into the Dockerfile. Otherwise this doesn't work on a host without npm. This approach worked yesterday.# ---- Dependencies ---- FROM base AS dependencies RUN npm i RUN npm ci
Today looks like it's breaking when I get the latest version form main.
npm notice npm notice New major version of npm available! 9.6.3 -> 10.2.4 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.4> npm notice Run `npm install -g npm@10.2.4` to update! npm notice npm ERR! code EUNSUPPORTEDPROTOCOL npm ERR! Unsupported URL Type "workspace:": workspace:* npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-11-23T11_47_26_971Z-debug-0.log
I can see commits have been made to the package.json file. /
Try this and let me know if it works for you. Works in my Coolify docker app EDIT Nevermind it ended up crashing so going to restructure this.
No luck.
Will complain about missing pnpm-lock.yaml So I copied it from root:
$ cp ../../pnpm-lock.yaml .
$ cp ../../package.json .
Sending build context to Docker daemon 2.192MB
Step 1/21 : FROM node:19-alpine AS base
---> e2a8cc97f817
Step 2/21 : WORKDIR /app
---> Using cache
---> c16f1b42f5ab
Step 3/21 : RUN npm install -g pnpm
---> Using cache
---> b11eff3dab53
Step 4/21 : COPY package*.json pnpm-lock.yaml ./
---> Using cache
---> 4566546a5a3c
Step 5/21 : COPY .env.local .env.local
---> Using cache
---> cebbd926d3de
Step 6/21 : FROM base AS dependencies
---> cebbd926d3de
Step 7/21 : RUN pnpm install --frozen-lockfile
---> Using cache
---> 147977990791
Step 8/21 : FROM dependencies AS build
---> 147977990791
Step 9/21 : COPY . .
---> 95fcf422683c
Step 10/21 : RUN pnpm run build
---> Running in f060c6a35729
WARN The "workspaces" field in package.json is not supported by pnpm. Create a "pnpm-workspace.yaml" file instead.
> monorepo@ build /app
> turbo run build
• Running build
• Remote caching disabled
root task build (turbo run build) looks like it invokes turbo and might cause a loop
No tasks were executed as part of this run.
Tasks: 0 successful, 0 total
Cached: 0 cached, 0 total
Time: 1.064s
ERROR run failed: command exited (1)
ELIFECYCLE Command failed with exit code 1.
The command '/bin/sh -c pnpm run build' returned a non-zero code: 1
No luck.
- clone from master
- cd unsaged/apps/unsaged
Will complain about missing pnpm-lock.yaml So I copied it from root:
$ cp ../../pnpm-lock.yaml . $ cp ../../package.json .
Sending build context to Docker daemon 2.192MB Step 1/21 : FROM node:19-alpine AS base ---> e2a8cc97f817 Step 2/21 : WORKDIR /app ---> Using cache ---> c16f1b42f5ab Step 3/21 : RUN npm install -g pnpm ---> Using cache ---> b11eff3dab53 Step 4/21 : COPY package*.json pnpm-lock.yaml ./ ---> Using cache ---> 4566546a5a3c Step 5/21 : COPY .env.local .env.local ---> Using cache ---> cebbd926d3de Step 6/21 : FROM base AS dependencies ---> cebbd926d3de Step 7/21 : RUN pnpm install --frozen-lockfile ---> Using cache ---> 147977990791 Step 8/21 : FROM dependencies AS build ---> 147977990791 Step 9/21 : COPY . . ---> 95fcf422683c Step 10/21 : RUN pnpm run build ---> Running in f060c6a35729 WARN The "workspaces" field in package.json is not supported by pnpm. Create a "pnpm-workspace.yaml" file instead. > monorepo@ build /app > turbo run build • Running build • Remote caching disabled root task build (turbo run build) looks like it invokes turbo and might cause a loop No tasks were executed as part of this run. Tasks: 0 successful, 0 total Cached: 0 cached, 0 total Time: 1.064s ERROR run failed: command exited (1) ELIFECYCLE Command failed with exit code 1. The command '/bin/sh -c pnpm run build' returned a non-zero code: 1
Okay let me work on a proper docket file for standard use. My environment is a bit different so I'll switch to my other server.
What os you running?
one without npm installed :) .. Oracle Linux or Linux Flatcar
Ooooo lol Might be a bit beyond my knowledge but I'll play with it once I wrap up work
I also have a GitHub workflow to make this image on their free servers and post it in dockerhub. I need to tweak it due to the recent changes but that's another option
that even better!
On Thu, 30 Nov 2023, 20:56 Bortus-AI, @.***> wrote:
I also have a GitHub workflow to make this image on their free servers and post it in dockerhub. I need to tweak it due to the recent changes but that's another option
— Reply to this email directly, view it on GitHub https://github.com/jorge-menjivar/unsaged/issues/104#issuecomment-1834548475, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOPPAYTME43VFFO6QEB5SLYHDXI3AVCNFSM6AAAAAA7XU5HEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGU2DQNBXGU . You are receiving this because you authored the thread.Message ID: @.***>
that even better! … On Thu, 30 Nov 2023, 20:56 Bortus-AI, @.> wrote: I also have a GitHub workflow to make this image on their free servers and post it in dockerhub. I need to tweak it due to the recent changes but that's another option — Reply to this email directly, view it on GitHub <#104 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOPPAYTME43VFFO6QEB5SLYHDXI3AVCNFSM6AAAAAA7XU5HEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGU2DQNBXGU . You are receiving this because you authored the thread.Message ID: @.>
Yeah its super nice. Auto builds and pushes it so no need to worry about all the dependencies and building locally. I'll work on that again this evening
I also had this issue. I had to remove the eslint line and force it to use npm
that even better! … On Thu, 30 Nov 2023, 20:56 Bortus-AI, @.> wrote: I also have a GitHub workflow to make this image on their free servers and post it in dockerhub. I need to tweak it due to the recent changes but that's another option — Reply to this email directly, view it on GitHub <#104 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOPPAYTME43VFFO6QEB5SLYHDXI3AVCNFSM6AAAAAA7XU5HEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGU2DQNBXGU . You are receiving this because you authored the thread.Message ID: @.>
I got the dockerfle to build and run okay so making some progress. Will start working on the GitHub workflow and auto building the image so you don't need pnpm installed
If you want a copy of my github workflow to build and create the docker image I can share it.
In order to build the project I'm adding
npm i
into the Dockerfile. Otherwise this doesn't work on a host without npm. This approach worked yesterday.Today looks like it's breaking when I get the latest version form main.
I can see commits have been made to the package.json file.