Docker compose for VSCode server
Set up Visual Studio Code server for development environment
Set up VSCode server
The original repository:
Github: https://github.com/cdr/code-server
docker-compose.yml
version: '3.3'
services:
code-server:
image: codercom/code-server
ports:
- '8181:8080'
volumes:
- '$HOME/.config:/home/coder/.config'
- '$PWD:/home/coder/project'
working_dir: /home/coder/project
environment:
PASSWORD: vscode
user: root
ipc: host
restart: unless-stopped # or "always"
Run docker container:
$ docker-compose up -d
Open your browser @ localhost:8181
. Password to access: vscode (specified in the above script)
ps. Change the port 8181 to your favorite one.
Configure NGINX
Setup with HTTP (port 80):
server {
listen 80;
### server_name YOUR_DOMAIN.COM;
server_name _;
sendfile on;
charset utf-8;
# max upload size
client_max_body_size 50G; # adjust to taste
location / {
proxy_pass http://0.0.0.0:8181/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
Setup with HTTPS (port 443):
server {
listen 80;
listen [::]:80;
### server_name YOUR_DOMAIN.COM;
server_name _;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
### server_name YOUR_DOMAIN.COM;
server_name _;
### paths to certificate files
ssl_certificate /root/ssl/official/gveyes/gveyes_net.cert;
ssl_certificate_key /root/ssl/official/gveyes/gveyes_net.key;
sendfile on;
charset utf-8;
# max upload size
client_max_body_size 50G; # adjust to taste
location / {
proxy_pass http://0.0.0.0:8181/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
More docker-compose files for you:
- Docker Compose for Traefik (reverse proxy HTTP)
- Set up Nginx reverse proxy HTTP/HTTPS with Docker Compose
- Docker compose for VSCode server
- Set up Pytorch Env with Docker within 1 Minute
- Docker Compose for Jekyll
- Docker Compose for Odoo 10
- Docker Compose for Odoo 11
- Docker Compose for Odoo 12
- Docker Compose for Odoo 13