Refresh code server

This commit is contained in:
ChenKaiLiuG
2025-11-17 01:29:22 +08:00
parent ffeb3768f3
commit 21da4e0d0d
5 changed files with 30 additions and 655 deletions

View File

@@ -1,65 +1,43 @@
version: '3.8'
services:
coder:
image: ghcr.io/coder/coder:latest
container_name: coder
code-server:
image: codercom/code-server:latest
container_name: code-server
restart: unless-stopped
environment:
# === 資料庫 ===
CODER_PG_CONNECTION_URL: postgresql://coder:${POSTGRES_PASSWORD}@postgres:5432/coder?sslmode=disable
# === 外部 URL ===
CODER_ACCESS_URL: https://code.karylab.com
CODER_WILDCARD_ACCESS_URL: "*.code.karylab.com"
# === TLS 由 Nginx 處理 ===
CODER_TLS_ENABLE: "false"
# === GitHub OIDC ===
CODER_OIDC_ISSUER_URL: https://token.actions.githubusercontent.com
CODER_OIDC_CLIENT_ID: ${CODER_OIDC_CLIENT_ID}
CODER_OIDC_CLIENT_SECRET: ${CODER_OIDC_CLIENT_SECRET}
CODER_OIDC_ALLOW_SIGNUPS: "true"
CODER_ADDRESS: 0.0.0.0:3000
CODER_HOME: /config/coder
# GitHub OAuth 認證
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID}
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
OAUTH_AUTHORIZE_URL: https://github.com/login/oauth/authorize
OAUTH_TOKEN_URL: https://github.com/login/oauth/access_token
OAUTH_USER_ID_TOKEN_CLAIM: login
volumes:
# 使用者 config.config, .cache, extensions→ volume
- user_config:/config/users
# 使用者程式碼 → 宿主實體目錄bind mount
- /mnt/data/External/code:/projects
# Coder 系統設定 → volume
- coder_system:/config/coder
# 程式碼目錄
- /mnt/data/External/code:/home/coder/project
# VSCode 設定
- code-server-config:/home/coder/.config
# 快取
- code-server-cache:/home/coder/.cache
ports:
- "6800:8443"
networks:
- coder-net
- webproxy # webproxy 網橋
depends_on:
- postgres
postgres:
image: postgres:15-alpine
container_name: coder-postgres
restart: unless-stopped
environment:
POSTGRES_DB: coder
POSTGRES_USER: coder
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- coder-net
- webproxy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8443"]
interval: 30s
timeout: 10s
retries: 3
volumes:
user_config: # 所有使用者 .config, .cache
coder_system: # Coder 系統設定
postgres_data: # 資料庫
code-server-config:
code-server-cache:
networks:
coder-net:
driver: bridge
webproxy:
external: true #外部網橋
external: true