How to add files into /app/data?
-
How do you add files into /app/data from inside a docker container?
Please point me to a sample repo if it exists on git.cloudron.io. Couldnt find one myself.
-
When an app is installed,
/app/datais 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 calledstart.sh)For example surfer needs a public folder in
/app/dataso this happens at https://git.cloudron.io/cloudron/surfer/-/blob/master/start.sh#L8 -
@nebulon Thanks!
For anyone else, this is how I did it.
In 'Dockerfile', I added the files into the /app/code directory using:
COPY public /app/code/temp-publicThen, in 'start.sh' I added the following to ensure it only copies files over on first run:
if [[ -z "$(ls -A /app/data/public)" ]]; then echo "==> Add public files on first run" cp -r /app/code/temp-public/* /app/data/public/ else echo "==> Do not override existing public folder" fi
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login