Create a Content with Files Over 100MB
Currently contents can contain up to 100MB of files in the watched directory (typically
/home/nt-user/workspace
). If there are large files in a content that a user will not need to edit, the following steps can be taken to add them to the content:- 1.Create a content using the Creator.
- 2.Add the names of the large files or folders in the Excluded Files Patterns list as shown in the image below. Note that multiple entries should be separated by newlines and the
*
wildcard character is supported. - 3.Create a compressed archive of the files that were added in the Excluded Files Patterns.Ex.
tar -czvf node_modules.tgz /home/nt-user/workspace/hello-world/node_modules
- 4.Upload the archive to a cloud storage provider such as AWS S3 or Google Storage. Uploading it to a public GitHub repository also works (the raw URL from GitHub can be used in the next step to download the file).
- 5.Add a startup script to download and extract the archive into the content. An example of a possible startup script is as follows (click here for more information on adding startup scripts):
wget -q -O /tmp/node_modules.tgz https://example.com/node_modules.tgz
mkdir -p /home/nt-user/workspace/hello-world/node_modules/
tar -xzf /tmp/node_modules.tgz --directory /home/nt-user/workspace/hello-world/node_modules/ --strip-components=1
rm -f /tmp/node_modules.tgz
This uses
wget
to download the compressed node_modules.tgz file to the /tmp directory. Next it ensures the destination folder exists. Then it extracts the compressed files to the desired folder. Finally it removes the archive that was downloaded to the /tmp directory.That's it! The large files will now be downloaded to the content each time it is launched.
Last modified 2yr ago