简体   繁体   English

MUP(流星)部署删除文件

[英]MUP (meteor) deploy deletes files

Sadly although mup deploy works perfectly, I have a folder called ".uploads", which users can upload files into. 遗憾的是,尽管mup deploy可以完美运行,但是我有一个名为“ .uploads”的文件夹,用户可以将文件上传到其中。

Each deploy deletes the files in the directory. 每次部署都会删除目录中的文件。 I would like to exclude or protect the file from the deploy deleting the files, any ideas? 我想从部署中排除或保护文件,删除文件,有什么想法吗?

Currently I filed an issue: https://github.com/arunoda/meteor-up/issues/1022 目前,我提出了一个问题: https : //github.com/arunoda/meteor-up/issues/1022

Not sure if its an issue with mup or my system setup. 不知道它是否与Mup或我的系统设置有关。 I use tomitrescak:meteor-uploads and also cfs:file-collection. 我使用tomitrescak:meteor-uploads以及cfs:file-collection。 They both have the same issue. 他们都有相同的问题。

But from what I see it shall be easy to do, you need to modify the script at https://github.com/arunoda/meteor-up/blob/mupx/templates/linux/start.sh#L26 但是从我看来这很容易做到,您需要在https://github.com/arunoda/meteor-up/blob/mupx/templates/linux/start.sh#L26修改脚本

And add a new mapping. 并添加一个新的映射。 You can map multiple volumes such as following: Mounting multiple volumes on a docker container? 您可以映射多个卷,如下所示: 在Docker容器上挂载多个卷?

So your script would look like (mounting the folder on the host machine /opt/uploads/myapp to the folder /opt/uploads in the container): 因此您的脚本看起来像(将主机/ opt / uploads / myapp上的文件夹安装到容器中的文件夹/ opt / uploads中):

docker run \
    -d \
    --restart=always \
    --publish=$PORT:80 \
    --volume=$BUNDLE_PATH:/bundle \
    --volume=/opt/uploads/myapp:/opt/uploads/ \      .... this is the new line
    --env-file=$ENV_FILE \
    --link=mongodb:mongodb \
    --hostname="$HOSTNAME-$APPNAME" \
    --env=MONGO_URL=mongodb://mongodb:27017/$APPNAME \
    --name=$APPNAME \
    meteorhacks/meteord:base

This can be found in "start.sh" in MUP until this issue is resolved and you can mount volumes via the options. 在此问题解决之前,您可以在MUP的“ start.sh”中找到它,并且可以通过选项安装卷。

Also see discussion here: https://github.com/tomitrescak/meteor-uploads/issues/235#issuecomment-228618130 另请参阅此处的讨论: https : //github.com/tomitrescak/meteor-uploads/issues/235#issuecomment-228618130

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM