rclone
This commit is contained in:
@@ -14,6 +14,9 @@ RUN sudo chown -R coder:coder /home/coder/.local
|
||||
# Port for railway
|
||||
ENV export PORT=80
|
||||
|
||||
# Install rclone (support for remote filesystem)
|
||||
RUN apt-get install rclone -y
|
||||
|
||||
# Use our custom entrypoint script first
|
||||
COPY railway-entrypoint.sh /usr/bin/railway-entrypoint.sh
|
||||
ENTRYPOINT ["/usr/bin/railway-entrypoint.sh"]
|
||||
|
||||
@@ -6,5 +6,16 @@ START_DIR=${1:-/home/coder/project}
|
||||
# Clone the git repo, if it exists
|
||||
[ -z "${GIT_REPO}" ] && echo "No GIT_REPO specified"; git clone $GIT_REPO $START_DIR
|
||||
|
||||
# add rclone config and start rclone, if supplied
|
||||
if [[ -z "${RCLONE_CONFIG}" ]]; then
|
||||
echo "RCLONE_CONFIG is not specified. Files will not persist"
|
||||
else
|
||||
echo "Copying rclone config..."
|
||||
echo $RCLONE_CONFIG | base64 -d > .rclone.conf
|
||||
|
||||
# serve remote files on the first item in the rclone config
|
||||
rclone serve sftp code-server-files:/home/coder/ --no-auth --vfs-cache-mode full&
|
||||
fi
|
||||
|
||||
# Now we can run code-server with the default entrypoint
|
||||
/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 $START_DIR
|
||||
Reference in New Issue
Block a user