From ade3cefa333c88a09cdf721ab8d1b25604a52212 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 4 Mar 2021 04:04:37 -0500 Subject: [PATCH] another refactor :D --- .github/workflows/to-dockerhub.yml | 1 - Dockerfile | 24 +++++++++++++++++-- README.md | 2 +- deploy-container/Dockerfile | 24 ------------------- deploy-container/README.md | 8 +++---- ...-container-entrypoint.sh => entrypoint.sh} | 0 vm-script/README.md | 1 + 7 files changed, 28 insertions(+), 32 deletions(-) delete mode 100644 deploy-container/Dockerfile rename deploy-container/{deploy-container-entrypoint.sh => entrypoint.sh} (100%) create mode 100644 vm-script/README.md diff --git a/.github/workflows/to-dockerhub.yml b/.github/workflows/to-dockerhub.yml index 1ce151e..96bbb1b 100644 --- a/.github/workflows/to-dockerhub.yml +++ b/.github/workflows/to-dockerhub.yml @@ -21,6 +21,5 @@ jobs: with: push: true tags: bencdr/code-server-deploy-container:latest - file: deploy-container/Dockerfile - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index b379681..f1c4edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,30 @@ -# Start with our deploy-container image (Debian) -FROM bencdr/deploy-container:latest +# Start from the code-server Debian base image +FROM codercom/code-server:latest USER coder +# Apply VS Code settings +COPY deploy-container/settings.json .local/share/code-server/User/settings.json + +# Use bash shell +ENV SHELL=/bin/bash + +# Install unzip + rclone (support for remote filesystem) +RUN sudo apt-get update && sudo apt-get install unzip -y +RUN curl https://rclone.org/install.sh | sudo bash + # You can add custom software and dependencies for your environment here. Some examples: # RUN code-server --install-extension esbenp.prettier-vscode # RUN sudo apt-get install -y build-essential # RUN COPY myTool /home/coder/myTool + +# Fix permissions for code-server +RUN sudo chown -R coder:coder /home/coder/.local + +# Port +ENV PORT=8080 + +# Use our custom entrypoint script first +COPY deploy-container/entrypoint.sh /usr/bin/deploy-container-entrypoint.sh +ENTRYPOINT ["/usr/bin/deploy-container-entrypoint.sh"] diff --git a/README.md b/README.md index 8574c87..8873490 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A collection of one-click buttons and scripts for deploying code-server to vario - You need to save "snapshots" to use your latest images - Storage is always persistent, and you can usually add extra volumes - VMs can support many workloads, such as running Docker or Kubernetes clusters - - [👀 Preview the VM install script](vm-script/) + - [👀 Docs for the VM install script](vm-script/) - App Platforms deploy code-server containers, and are often rebuilt - App platforms can shut down when you are not using it, saving you money - All software and dependencies need to be defined in the `Dockerfile` or install script so they aren't destroyed on a rebuild diff --git a/deploy-container/Dockerfile b/deploy-container/Dockerfile deleted file mode 100644 index 6c7f270..0000000 --- a/deploy-container/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Start from the code-server Debian base image -FROM codercom/code-server:latest - -USER coder - -# Apply VS Code settings -COPY settings.json .local/share/code-server/User/settings.json - -# Use bash shell -ENV SHELL=/bin/bash - -# Install unzip + rclone (support for remote filesystem) -RUN sudo apt-get update && sudo apt-get install unzip -y -RUN curl https://rclone.org/install.sh | sudo bash - -# Fix permissions for code-server -RUN sudo chown -R coder:coder /home/coder/.local - -# Port -ENV PORT=8080 - -# Use our custom entrypoint script first -COPY deploy-container-entrypoint.sh /usr/bin/deploy-container-entrypoint.sh -ENTRYPOINT ["/usr/bin/deploy-container-entrypoint.sh"] diff --git a/deploy-container/README.md b/deploy-container/README.md index 0e7fb02..8e4d715 100644 --- a/deploy-container/README.md +++ b/deploy-container/README.md @@ -6,11 +6,11 @@ An image built for deploying code-server to [railway.app](https://railway.app), To launch your code-server environment, click the button below and log in with GitHub: -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Fbpmct%2Fcode-server-railway&envs=PASSWORD%2CGIT_REPO&PASSWORDDesc=Your+password+to+log+in+to+code-server+with&GIT_REPODesc=A+git+repo+to+clone+and+open+in+code-server+%28ex.+https%3A%2F%2Fgithub.com%2Fcdr%2Fdocs.git%29) +| [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Fbpmct%2Fcode-server-railway&envs=PASSWORD%2CGIT_REPO&PASSWORDDesc=Your+password+to+log+in+to+code-server+with&GIT_REPODesc=A+git+repo+to+clone+and+open+in+code-server+%28ex.+https%3A%2F%2Fgithub.com%2Fcdr%2Fdocs.git%29) | [![Deploy on Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/bpmct/deploy-code-server/tree/main) | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| For Railway, it will ask you to make a new repo to store this image, so you can add additional software to your repo's `Dockerfile` in the future. | For Heroku, we recommend [using this repo as a template](https://github.com/bpmct/code-server-railway/generate) and using the one-click deploy on your own repo to further modify your app. | -For Railway, it will ask you to make a new repo to store this image, so you can add additional software to your repo's `Dockerfile` in the future. - -For Heroku, we recommend [using this repo as a template](https://github.com/bpmct/code-server-railway/generate) and using the one-click deploy on your own repo to further modify your app. +--- ## 💾 Persist your filesystem with `rclone` diff --git a/deploy-container/deploy-container-entrypoint.sh b/deploy-container/entrypoint.sh similarity index 100% rename from deploy-container/deploy-container-entrypoint.sh rename to deploy-container/entrypoint.sh diff --git a/vm-script/README.md b/vm-script/README.md new file mode 100644 index 0000000..4346b13 --- /dev/null +++ b/vm-script/README.md @@ -0,0 +1 @@ +yep it is coming