Skip to content

Lgunn4/updating config #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d36b636
Update to-dockerhub.yml
lgunn4 Jun 20, 2023
7261603
Update Dockerfile
lgunn4 Jun 20, 2023
8222ee2
Update Dockerfile
lgunn4 Jun 20, 2023
40ae670
Update entrypoint.sh
lgunn4 Jun 20, 2023
32aea4b
Update Dockerfile
lgunn4 Jun 20, 2023
eed2856
stuff
lgunn4 Jun 20, 2023
ec3221a
e
lgunn4 Jun 20, 2023
f6e5d48
sudo
lgunn4 Jun 20, 2023
846064e
maybe
lgunn4 Jun 20, 2023
f82d4ff
trying
lgunn4 Jun 20, 2023
d26bf65
again?
lgunn4 Jun 20, 2023
f17faa8
trying again
lgunn4 Jun 20, 2023
24f9ae0
trying
lgunn4 Jun 21, 2023
02a1099
please
lgunn4 Jun 21, 2023
b81f562
Merge branch 'main' of https://github.com/lgunn4/deploy-code-server
lgunn4 Jun 21, 2023
af15349
ee
lgunn4 Jun 21, 2023
be8d14a
trying something
lgunn4 Jun 21, 2023
24b4531
full send
lgunn4 Jun 21, 2023
a5b3efd
fixed it
lgunn4 Jun 21, 2023
01483ff
Adding NVM and react installing
lgunn4 Jun 29, 2023
ba86528
e
lgunn4 Jun 29, 2023
1ea14e7
Hopefully this works
lgunn4 Jun 29, 2023
7b1b149
Merge branch 'main' of https://github.com/lgunn4/deploy-code-server
lgunn4 Jun 29, 2023
001aa80
Hopefully
lgunn4 Jun 29, 2023
5ef2ca5
maybe
lgunn4 Jun 29, 2023
b1c2060
trying
lgunn4 Jun 29, 2023
63ed01c
trying to install nvm
lgunn4 Sep 18, 2023
b8bcdfc
trying to install node
lgunn4 Sep 18, 2023
2db5f89
please work
lgunn4 Sep 18, 2023
71beb40
☊ Added Node
lgunn4 Jan 19, 2024
b345d19
Updating node and npm
lgunn4 Jan 19, 2024
38a3f03
trying n
lgunn4 Jan 19, 2024
f581746
forgot sudo
lgunn4 Jan 19, 2024
32c869c
code server config changes
lgunn4 Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions .github/workflows/to-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
name: Publish to Docker Hub
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
push:
branches:
- main
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: logunn78/code-server

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: bencdr/code-server-deploy-container:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
31 changes: 26 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,35 @@ RUN sudo chown -R coder:coder /home/coder/.local
# Install apt packages:
# RUN sudo apt-get install -y ubuntu-make

# Copy files:
# COPY deploy-container/myTool /home/coder/myTool
# Install rbenv and dependencies
RUN sudo apt-get install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
RUN echo 'eval "$(rbenv init -)"' >> ~/.bashrc

RUN ~/.rbenv/bin/rbenv install 3.2.2


# Installing Node
ENV NVM_DIR /home/coder/.nvm
ENV NODE_VERSION 20.5.0

RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.20.0/install.sh | bash

ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH

RUN sudo apt-get install -y nodejs
RUN sudo apt-get install -y npm
RUN sudo apt-get update
RUN sudo apt-get upgrade -y nodejs npm

RUN git config --global user.email "lgunn4@uwo.ca" && git config --global user.name "Logan Gunn"

# -----------

# Port
ENV PORT=8080
ENV PORT=3000

# Use our custom entrypoint script first
COPY deploy-container/entrypoint.sh /usr/bin/deploy-container-entrypoint.sh
ENTRYPOINT ["/usr/bin/deploy-container-entrypoint.sh"]
ENTRYPOINT ["/usr/bin/deploy-container-entrypoint.sh"]
4 changes: 2 additions & 2 deletions deploy-container/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ -z "${RCLONE_DATA}" ]]; then

else
echo "[$PREFIX] Copying rclone config..."
mkdir -p /home/coder/.config/rclone/
mkdir -p /home/coder/`.config/`rclone/
touch /home/coder/.config/rclone/rclone.conf
echo $RCLONE_DATA | base64 -d > /home/coder/.config/rclone/rclone.conf

Expand Down Expand Up @@ -97,4 +97,4 @@ fi

echo "[$PREFIX] Starting code-server..."
# Now we can run code-server with the default entrypoint
/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 $START_DIR
/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:3000 $START_DIR
7 changes: 3 additions & 4 deletions deploy-vm/launch-code-server-linode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ sudo hostnamectl set-hostname linode-$LINODE_ID
source /root/.bashrc

# configure code-server to use --link with the "coder" user
mkdir -p /home/coder/.config/code-server
touch /home/coder/.config/code-server/config.yaml
echo "link: true" > /home/coder/.config/code-server/config.yaml
chown -R coder:coder /home/coder/.config
if [[ ! -d /home/coder/.config/code-server ]]; then
echo "NO config has been set; please set a config file at /home/coder/.config/code-server"
fi

# start and enable code-server and our helper service
systemctl enable code-server@coder
Expand Down
8 changes: 4 additions & 4 deletions deploy-vm/launch-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cp -r /root/.ssh /home/coder/.ssh
chown -R coder:coder /home/coder/.ssh

# configure code-server to use --link with the "coder" user
mkdir -p /home/coder/.config/code-server
touch /home/coder/.config/code-server/config.yaml
echo "link: true" > /home/coder/.config/code-server/config.yaml
chown -R coder:coder /home/coder/.config
if [[ ! -d /home/coder/.config/code-server ]]; then
echo "NO config has been set; please set a config file at /home/coder/.config/code-server"
fi


# start and enable code-server and our helper service
systemctl enable --now code-server@coder
Expand Down
Loading