-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathdocker-compose.sandbox.yml
More file actions
112 lines (107 loc) · 2.62 KB
/
docker-compose.sandbox.yml
File metadata and controls
112 lines (107 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
x-sandbox-common: &sandbox-common
build:
context: .
dockerfile: docker/sandbox/Dockerfile
working_dir: /workspace
environment:
GOCACHE: /go/build-cache
volumes:
- .:/workspace
- go-mod-cache:/go/pkg/mod
- go-build-cache:/go/build-cache
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
cpus: "2"
memory: "2G"
services:
sandbox-offline:
<<: *sandbox-common
profiles:
- offline
command:
- ./scripts/test.sh
network_mode: none
environment:
HOME: /tmp
GOCACHE: /go/build-cache
sandbox-online:
<<: *sandbox-common
profiles:
- online
command:
- ./scripts/test.sh
environment:
HOME: /tmp
GOCACHE: /go/build-cache
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
GITLAB_TOKEN: ${GITLAB_TOKEN:-}
BITBUCKET_TOKEN: ${BITBUCKET_TOKEN:-}
BITBUCKET_USERNAME: ${BITBUCKET_USERNAME:-}
SKILLSHARE_GIT_TOKEN: ${SKILLSHARE_GIT_TOKEN:-}
sandbox-playground:
<<: *sandbox-common
profiles:
- playground
read_only: true
cap_drop:
- ALL
command:
- sleep
- infinity
ports:
- "19420:19420"
environment:
HOME: /sandbox-home
GOCACHE: /go/build-cache
PATH: /sandbox-home/.local/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GITHUB_TOKEN: ${SKILLSHARE_PLAYGROUND_GITHUB_TOKEN:-}
GITLAB_TOKEN: ${GITLAB_TOKEN:-}
BITBUCKET_TOKEN: ${BITBUCKET_TOKEN:-}
BITBUCKET_USERNAME: ${BITBUCKET_USERNAME:-}
SKILLSHARE_GIT_TOKEN: ${SKILLSHARE_GIT_TOKEN:-}
volumes:
- .:/workspace:ro
- go-mod-cache:/go/pkg/mod
- go-build-cache:/go/build-cache
- playground-home:/sandbox-home
tmpfs:
- /tmp:exec,mode=1777,size=256m
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:19420/api/health || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
sandbox-dev:
<<: *sandbox-common
profiles:
- dev
command:
- bash
- -c
- >-
cd /workspace &&
go run ./cmd/skillshare init -g --no-copy --no-git --skill 2>/dev/null;
go run ./cmd/skillshare ui -g --no-open --host 0.0.0.0
ports:
- "19420:19420"
environment:
HOME: /tmp
GOCACHE: /go/build-cache
develop:
watch:
- action: rebuild
path: ./cmd
- action: rebuild
path: ./internal
- action: rebuild
path: ./go.mod
- action: rebuild
path: ./go.sum
volumes:
go-mod-cache:
go-build-cache:
playground-home: