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:/certs
Or 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:/certs
services:
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:/certs
The 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 run
anddocker-compose
- Write example for
HTTPS
and certificates - Write example for
GITHUB_TOKEN
- Handle
$EXTENSIONS
to install extensions - Handle
$SETTINGS
to set the settings.json - Handle
$WORKSPACE
to set the workspace