-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from saagie/feature/vscode
Feature/vscode
- Loading branch information
Showing
6 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# VS Code | ||
|
||
## Description | ||
This directory contains a VsCode server contenairized and customized for Saagie Platform. | ||
See Vscode server official documentation for more information https://code.visualstudio.com/docs/ | ||
|
||
## How to build in local | ||
|
||
``` | ||
docker build -t saagie/vscode-server . | ||
docker push saagie/vscode-server | ||
``` | ||
|
||
## How to run image in local | ||
|
||
``` | ||
docker build -t saagie/vscode-server . | ||
docker run -e "SAAGIE_BASE_PATH=/hello" -p 80:80 saagie/vscode-server | ||
``` | ||
And access it with this adress: [localhost/coucou/](localhost/coucou/) | ||
|
||
## Job/App specific information | ||
If you want to configure a password to access your VsCode Server, you need to setup an environment Variable named "PASSWORD" and enter your password (see Saagie [documentation](https://docs.saagie.io/user/latest/tutorials/projects-module/projects/envar/index.html#projects-create-envar-global)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: v1 | ||
type: APP | ||
id: vscode | ||
label: VsCode | ||
baseline: "VsCode server" | ||
description: "VsCode server is an IDE that supports several languages. \nCreate an environment variable named 'PASSWORD' to set a password." | ||
available: true | ||
icon: vscode | ||
backgroundColor: "#3EAAF2" | ||
customFlags: [] | ||
contexts: | ||
- id: vscode-3.9.0 | ||
label: VsCode 3.9.0 | ||
releaseNotes: "" | ||
available: true | ||
trustLevel: experimental | ||
ports: | ||
- port: 80 | ||
name: vscode | ||
rewriteUrl: false | ||
basePath: SAAGIE_BASE_PATH | ||
volumes: ["/config/workspace"] | ||
dockerInfo: | ||
image: saagie/vscode-server | ||
version: 3.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ghcr.io/linuxserver/code-server:version-v3.9.0 | ||
|
||
USER root | ||
|
||
ENV PUID=1000 | ||
ENV PGID=1000 | ||
RUN TZ=Europe/London | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y nginx \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/ \ | ||
&& rm /etc/nginx/sites-enabled/default | ||
|
||
COPY ressources/nginx.conf /etc/nginx/sites-enabled/nginx.conf | ||
COPY ressources/entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh \ | ||
&& chmod +x /etc/nginx/sites-enabled/nginx.conf | ||
|
||
EXPOSE 8443 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
echo "Set Proxy" | ||
export PROXY_DOMAIN=$SAAGIE_BASE_PATH | ||
|
||
echo "SAAGIE_BASE_PATH" | ||
echo $SAAGIE_BASE_PATH | ||
echo "PROXY_DOMAIN" | ||
echo $PROXY_DOMAIN | ||
|
||
# /init | ||
|
||
sed -i 's:SAAGIE_BASE_PATH:'"$SAAGIE_BASE_PATH"':g' /etc/nginx/sites-enabled/nginx.conf | ||
nginx && /init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
map $http_connection $upgrade_requested { | ||
default upgrade; | ||
'' close; | ||
} | ||
server { | ||
listen 80 default_server; | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
|
||
location SAAGIE_BASE_PATH { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $upgrade_requested; | ||
# proxy_set_header Accept-Encoding "" | ||
proxy_read_timeout 20d; | ||
|
||
rewrite ^SAAGIE_BASE_PATH/(.*)$ /$1 break; | ||
rewrite ^SAAGIE_BASE_PATH$ / break; | ||
|
||
proxy_pass http://localhost:8443; | ||
|
||
proxy_redirect http://localhost:8443/ $scheme://$hostSAAGIE_BASE_PATH/; | ||
proxy_redirect https://localhost:8443/ $scheme://$hostSAAGIE_BASE_PATH/; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
version.buildmeta= | ||
version.buildmeta=feature/vscode | ||
version.major=0 | ||
version.minor=11 | ||
version.patch=0 | ||
version.prerelease= | ||
version.semver=0.11.0 | ||
version.prerelease=BETA | ||
version.semver=0.11.0-BETA+feature/vscode |