Skip to content

Update API Dockerfile#1231

Merged
mogery merged 1 commit intofirecrawl:loorisr/better-api-dockerfilefrom
loorisr:better_API_dockerfile
Feb 21, 2025
Merged

Update API Dockerfile#1231
mogery merged 1 commit intofirecrawl:loorisr/better-api-dockerfilefrom
loorisr:better_API_dockerfile

Conversation

@loorisr
Copy link
Contributor

@loorisr loorisr commented Feb 21, 2025

Update to latest version of tools.
Clean up
Reduce image size to 800mo (uncompressed)

See #1230

@mogery mogery changed the base branch from main to loorisr/better-api-dockerfile February 21, 2025 15:21

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app /app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not convinced this is the right move here, as we specifically only want the prod deps to be in the resulting image. A better solution seems to me like re-adding the prod-deps build and moving the copy order around.

Suggested change
COPY --from=build /app /app
COPY --from=build /app /app
COPY --from=prod-deps /app/node_modules /app/node_modules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree, I think you should copy /app/dist from the build docker . not /app
Cf https://pnpm.io/docker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just tried and it doesn't run. It does compile but then

Cannot find module 'mammoth'
Cannot find module 'express'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, saw the same. Trying to figure it out.

@mogery
Copy link
Member

mogery commented Feb 21, 2025

Merging this into a branch in the main repo first so I can run tests on it and deploy to staging properly. (CI difficulties 😅)

@mogery mogery merged commit e03ddf4 into firecrawl:loorisr/better-api-dockerfile Feb 21, 2025
0 of 17 checks passed
mogery added a commit that referenced this pull request Feb 21, 2025
* Update Dockerfile (#1231)

* Dockerfile: re-add prod-deps stage and fix copies

---------

Co-authored-by: Loris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants