Question

How to deploy subdirectory in monorepo without lockfile?

Hey! I have a yarn workspaces monorepo with packages/frontend and packages/backend directories and I just want to deploy packages/backend. I already defined the source_dir so it points to it but then DO can’t find a yarn.lock because it only exists at the root and not in packages/backend.

How can I configure it so it can find the yarn.lock at the root but only deploys the packages/backend directory?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @rudolphmarvin,

If you want to deploy the code present in packages/backend folder, specifying the source_dir with the folder name(packages/backend) is the right way. When you specify the source_dir that becomes the current working directory for your applications and only the files present in that folder are considered.

Since yarn.lock is not present in the packages/backend and app does not have access to the trailing folders(root folder of your repo), it is not found. In order for it to be detected, please ensure that the package.json, yarn.lock and other necessary files are present in the current folder(packages/backend) in this case.

In case you have any doubts, please reach out to our support team and we’d be glad to help.

Cheers, Taha Fatima