Skip to content

Commit 4382e1b

Browse files
committed
rclone
1 parent 86eed71 commit 4382e1b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN sudo chown -R coder:coder /home/coder/.local
1414
# Port for railway
1515
ENV export PORT=80
1616

17+
# Install rclone (support for remote filesystem)
18+
RUN apt-get install rclone -y
19+
1720
# Use our custom entrypoint script first
1821
COPY railway-entrypoint.sh /usr/bin/railway-entrypoint.sh
1922
ENTRYPOINT ["/usr/bin/railway-entrypoint.sh"]

railway-entrypoint.sh

+11
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,16 @@ START_DIR=${1:-/home/coder/project}
66
# Clone the git repo, if it exists
77
[ -z "${GIT_REPO}" ] && echo "No GIT_REPO specified"; git clone $GIT_REPO $START_DIR
88

9+
# add rclone config and start rclone, if supplied
10+
if [[ -z "${RCLONE_CONFIG}" ]]; then
11+
echo "RCLONE_CONFIG is not specified. Files will not persist"
12+
else
13+
echo "Copying rclone config..."
14+
echo $RCLONE_CONFIG | base64 -d > .rclone.conf
15+
16+
# serve remote files on the first item in the rclone config
17+
rclone serve sftp code-server-files:/home/coder/ --no-auth --vfs-cache-mode full&
18+
fi
19+
920
# Now we can run code-server with the default entrypoint
1021
/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 $START_DIR

0 commit comments

Comments
 (0)