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
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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