<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to add files into /app/data?]]></title><description><![CDATA[<p dir="auto">How do you add files into /app/data from inside a docker container?</p>
<p dir="auto">Please point me to a sample repo if it exists on <a href="http://git.cloudron.io" target="_blank" rel="noopener noreferrer nofollow ugc">git.cloudron.io</a>. Couldnt find one myself.</p>
]]></description><link>https://forum.cloudron.io/topic/3701/how-to-add-files-into-app-data</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 16:27:36 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/3701.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Nov 2020 08:42:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to add files into /app/data? on Sat, 14 Nov 2020 23:44:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> Thanks!</p>
<p dir="auto">For anyone else, this is how I did it.</p>
<p dir="auto">In 'Dockerfile', I added the files into the /app/code directory using:</p>
<pre><code>COPY public /app/code/temp-public
</code></pre>
<p dir="auto">Then, in '<a href="http://start.sh" target="_blank" rel="noopener noreferrer nofollow ugc">start.sh</a>' I added the following to ensure it only copies files over on first run:</p>
<pre><code>if [[ -z "$(ls -A /app/data/public)" ]]; then
    echo "==&gt; Add public files on first run"
    cp -r /app/code/temp-public/* /app/data/public/
else
    echo "==&gt; Do not override existing public folder"
fi
</code></pre>
]]></description><link>https://forum.cloudron.io/post/19052</link><guid isPermaLink="true">https://forum.cloudron.io/post/19052</guid><dc:creator><![CDATA[saikarthik]]></dc:creator><pubDate>Sat, 14 Nov 2020 23:44:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to add files into /app/data? on Sat, 14 Nov 2020 10:05:13 GMT]]></title><description><![CDATA[<p dir="auto">When an app is installed, <code>/app/data</code> is mounted as a volume into the container, so things have to be added during runtime there. For packaging related data or initial config file templates, this usually is done in the apps entry point script (mostly called <code>start.sh</code>)</p>
<p dir="auto">For example surfer needs a public folder in <code>/app/data</code> so this happens at <a href="https://git.cloudron.io/cloudron/surfer/-/blob/master/start.sh#L8" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/cloudron/surfer/-/blob/master/start.sh#L8</a></p>
]]></description><link>https://forum.cloudron.io/post/19013</link><guid isPermaLink="true">https://forum.cloudron.io/post/19013</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Sat, 14 Nov 2020 10:05:13 GMT</pubDate></item></channel></rss>