inital version
This commit is contained in:
21
.env.sample
Normal file
21
.env.sample
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
BASEDIR=
|
||||||
|
CODETAG=
|
||||||
|
INTRANET=
|
||||||
|
|
||||||
|
PUID=1000
|
||||||
|
PGID=1000
|
||||||
|
TZ=Europe/Berlin
|
||||||
|
|
||||||
|
## optionals
|
||||||
|
PROXY_DOMAIN=code.example.com
|
||||||
|
DEFAULT_WORKSPACE=/config/workspace
|
||||||
|
|
||||||
|
## passwords user hashes or plaintext not both
|
||||||
|
PASSWORD=my-super-password
|
||||||
|
SUDO_PASSWORD=my-super-sudo-password
|
||||||
|
|
||||||
|
# not workint for me ...
|
||||||
|
#HASHED_PASSWORD='$$argon2i$$v=19$$m=4096,t=3,p=1$$K96ijeqOQ4P7sW+68/Ldtw$$5rutB8Kst0bk08WW8P5xJ5rh7nFtZw2enUvUPo5o5H4'
|
||||||
|
#SUDO_PASSWORD_HASH='$$argon2i$$v=19$$m=4096,t=3,p=1$$jpnaoU60MpfhJ8dHx9mIOA$$W00OHMW7KYrHvFgOmUDLakZhEx8sC/EXpJgP7DagGqM'
|
||||||
|
# hashed pw: echo -n "thisismypassword" | npx argon2-cli -e
|
||||||
|
# npm need
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
files/
|
||||||
|
*.env
|
||||||
52
README.md
52
README.md
@@ -1,2 +1,52 @@
|
|||||||
# compose-vscode
|
# Basic VS Code Server docker-compose config
|
||||||
|
* can be run on single node setup or in swarm
|
||||||
|
|
||||||
|
## howto
|
||||||
|
### single node
|
||||||
|
#### start container
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
#### stop container (and remove)
|
||||||
|
```bash
|
||||||
|
docker compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
#### view logs
|
||||||
|
```bash
|
||||||
|
docker compose logs -f
|
||||||
|
```
|
||||||
|
|
||||||
|
#### reload config
|
||||||
|
```bash
|
||||||
|
docker compose restart
|
||||||
|
```
|
||||||
|
|
||||||
|
### swarm
|
||||||
|
#### start aka deploy
|
||||||
|
```bash
|
||||||
|
docker stack deploy -c docker-compose.yml vscode
|
||||||
|
```
|
||||||
|
|
||||||
|
#### stop container aka service
|
||||||
|
```bash
|
||||||
|
docker service rm vscode_vscode
|
||||||
|
```
|
||||||
|
|
||||||
|
#### view logs
|
||||||
|
```bash
|
||||||
|
docker service logs vscode_vscode -f
|
||||||
|
```
|
||||||
|
|
||||||
|
#### reload config (no downtime if replica 2 or more)
|
||||||
|
```bash
|
||||||
|
docker service update vscode_vscode --force
|
||||||
|
```
|
||||||
|
|
||||||
|
## example caddy config
|
||||||
|
```
|
||||||
|
code.example.com {
|
||||||
|
reverse_proxy vscode:8443
|
||||||
|
}
|
||||||
|
```
|
||||||
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# https://docs.docker.com/compose/compose-file/compose-file-v3/
|
||||||
|
---
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
vscode:
|
||||||
|
image: lscr.io/linuxserver/code-server:${CODETAG:-latest}
|
||||||
|
container_name: vscode
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 8443:8443
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
placement:
|
||||||
|
max_replicas_per_node: 1
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 10s
|
||||||
|
volumes:
|
||||||
|
- ${BASEDIR:-.}/files:/config
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
networks:
|
||||||
|
backend:
|
||||||
|
name: ${INTRANET:-backend}
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user