From 5cddd80692fbaa1656e3fe9ccbf82e9a10cd238a Mon Sep 17 00:00:00 2001 From: Marcus Ahlfors Date: Thu, 22 Feb 2024 12:39:48 +0200 Subject: [PATCH] Add code-server service --- Dockerfile | 3 +++ diploi-runonce.sh | 1 + supervisord.conf | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 47a6765..7062a71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,9 @@ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \ RUN ln -s /etc/diploi-git/gitconfig /etc/gitconfig COPY diploi-credential-helper /usr/local/bin +# Install code server +curl -fsSL https://code-server.dev/install.sh | sh + # Init and run supervisor COPY diploi-runonce.sh /usr/local/bin/diploi-runonce.sh COPY supervisord.conf /etc/supervisord.conf diff --git a/diploi-runonce.sh b/diploi-runonce.sh index e062f0e..692082e 100644 --- a/diploi-runonce.sh +++ b/diploi-runonce.sh @@ -79,6 +79,7 @@ node /app/lib/seedDatabase.js # Now that everything is initialized, start all services supervisorctl start www +supervisorctl start code-server progress "Runonce done"; diff --git a/supervisord.conf b/supervisord.conf index b517061..2cdf6f9 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -52,3 +52,13 @@ stopasgroup=true killasgroup=true stdout_logfile=/var/log/status.log stderr_logfile=/var/log/status.log + +[program:code-server] +directory=/app +command=code-server --app-name Diploi --disable-telemetry --auth none --bind-addr 0.0.0.0:3001 /app +autostart=false +autorestart=true +stopasgroup=true +killasgroup=true +stdout_logfile=/var/log/code-server.log +stderr_logfile=/var/log/code-server.log