This project packages code-server into a custom Docker image, allowing you to freely add software packages within Docker.
.
├── docker
│ ├── Dockerfile
│ └── entrypoint.sh
├── Makefile
├── nginx
│ └── code.example.com.conf
└── README.md
- run: Runs the code-server container.
- logs: Displays logs for the code-server container.
- stop: Stops and removes the code-server container.
- upgrade: Pulls the latest image and stops the current container.
- restart: Stops and runs the code-server container.
- build: Builds the Docker image.
- publish: Pushes the Docker image to the repository.
- release: Builds and publishes the Docker image.
The following configuration is used to set up Nginx as a reverse proxy for the code-server:
server {
listen 80;
server_name code.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
charset utf-8;
root /dev/null;
index index.html;
server_name code.example.com;
ssl_certificate /etc/nginx/ssl/example.com.cert;
ssl_certificate_key /etc/nginx/ssl/example.com.key;
location / {
proxy_pass http://127.0.0.1:4040/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
-
Run the Container:
make run
This command runs the code-server container with the specified configurations.
-
View Logs:
make logs
This command displays the logs for the code-server container.
-
Stop the Container:
make stop
This command stops and removes the code-server container.
-
Upgrade the Container:
make upgrade
This command pulls the latest image and stops the current container.
-
Restart the Container:
make restart
This command stops and runs the code-server container.
-
Build the Docker Image:
make build
This command builds the Docker image.
-
Publish the Docker Image:
make publish
This command pushes the Docker image to the repository.
-
Release the Docker Image:
make release
This command builds and publishes the Docker image.
You can customize the Docker image by modifying the Dockerfile
and entrypoint.sh
in the docker
directory. This allows you to add any additional software packages or configurations as needed.
This project is licensed under the MIT License.