This commit is contained in:
Ben
2021-03-03 19:53:54 -05:00
parent 86eed7116a
commit 4382e1b052
2 changed files with 14 additions and 0 deletions

View File

@@ -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"]

View File

@@ -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