This is a containerized version of code-server, instead of using the official docker image, this project is based on fedora:latest in order to have more recent versions of the dependencies.
docker build -t mfe-code-server-* .docker run -d -p "8080:8080" -v '/path/to/project:/home/monke/workspaces/project' -e <...> mfe-code-server-*For custom builds:
services:
web:
build: .
ports:
- "8080:8080"
- "8443:8443"
environment:
- AUTHENTICATION_MODE=password
- HASHED_PASSWORD=${HASHED_PASSWORD}
- HTTPS=false
- PORT=8080
- DEBUG=
volumes:
- ./certs:/certsOr use prebuilt images:
services:
web:
image: mfe-code-server-x86:latest
ports:
- "8080:8080"
- "8443:8443"
environment:
- AUTHENTICATION_MODE=password
- HASHED_PASSWORD=${HASHED_PASSWORD}
- HTTPS=false
- PORT=8080
- DEBUG=
volumes:
- ./certs:/certsservices:
web:
image: mfe-code-server-arm:latest
ports:
- "8080:8080"
- "8443:8443"
environment:
- AUTHENTICATION_MODE=password
- HASHED_PASSWORD=${HASHED_PASSWORD}
- HTTPS=false
- PORT=8080
- DEBUG=
volumes:
- ./certs:/certsThe whole execution is modified by using specific environment variables, the following table shows the available variables and their default values:
| Variable | Default Value | Description |
|---|---|---|
| AUTHENTICATION_MODE | password | The authentication mode to access the code-server, it can be password or hashed |
| PASSWORD | password | The password to access the code-server |
| HASHED_PASSWORD | The hashed password to access the code-server | |
| PORT | 8080 | The port to expose the code-server |
| HTTPS | false | Enable HTTPS |
| GITHUB_TOKEN | The GitHub token to access the GitHub API | |
| DEBUG | false | Enable debug mode (log the executed command) |
If you want to enable HTTPS, you need to provide a volume mounted to /certs with the following files:
cert.pem: The certificate filekey.pem: The key file
- Write example for
docker runanddocker-compose - Write example for
HTTPSand certificates - Write example for
GITHUB_TOKEN - Handle
$EXTENSIONSto install extensions - Handle
$SETTINGSto set the settings.json - Handle
$WORKSPACEto set the workspace