54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: security-command
|
|
|
|
services:
|
|
spawner:
|
|
image: ${SPAWNER_IMAGE:?run deploy.sh}
|
|
restart: unless-stopped
|
|
# 10100 is the group shared with the backend for the spawner socket.
|
|
user: "10001:10100"
|
|
group_add:
|
|
- "${SANDBOX_GROUP_ID:?run deploy.sh}"
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
security_opt: [no-new-privileges:true]
|
|
network_mode: none
|
|
mem_limit: 128m
|
|
pids_limit: 64
|
|
environment:
|
|
SANDBOX_IMAGE: ${SANDBOX_IMAGE:?run deploy.sh}
|
|
CONTENT_DIR: ${CONTENT_DIR:?set CONTENT_DIR in .env}
|
|
STATUS_DIR: ${STATUS_DIR:?run deploy.sh}
|
|
volumes:
|
|
- /run/docker-sandbox/docker.sock:/run/docker-sandbox/docker.sock
|
|
- ./runtime/spawner:/run/spawner
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 10m
|
|
max-file: "3"
|
|
|
|
backend:
|
|
image: ${BACKEND_IMAGE:?run deploy.sh}
|
|
restart: unless-stopped
|
|
user: "10002:10002"
|
|
group_add:
|
|
- "10100"
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
security_opt: [no-new-privileges:true]
|
|
mem_limit: 256m
|
|
pids_limit: 128
|
|
depends_on: [spawner]
|
|
ports:
|
|
- "127.0.0.1:${BACKEND_PORT:-8380}:8080"
|
|
environment:
|
|
SPAWNER_SOCKET: /run/spawner/spawner.sock
|
|
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://security-command.org}
|
|
volumes:
|
|
- ./runtime/spawner:/run/spawner
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: 10m
|
|
max-file: "3"
|