i didn't do the knot docker stuff cuz i was focusing on spindle. but this is how i got it up and running at least on my local machine, idk if it takes jobs
+38
-107
Diff
round #0
+23
-49
Dockerfile
+23
-49
Dockerfile
···
1
1
2
+
FROM alpine AS runtime
2
3
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
-
RUN useradd -u $UID -g $GID -d /home/git git
46
-
RUN openssl rand -hex 16 | passwd --stdin git
47
-
RUN mkdir -p /home/git/repositories && chown -R git:git /home/git
48
-
COPY --from=build_knot /app/knot /usr/bin/knot
49
-
EXPOSE 5555
50
-
EXPOSE 22
51
-
USER git
4
+
FROM build AS tangled
5
+
COPY ./core /core
6
+
WORKDIR /core
7
+
RUN go mod download
8
+
9
+
FROM build AS build-spindle
10
+
WORKDIR /app
11
+
COPY --from=tangled /core .
12
+
RUN apk add alpine-sdk
13
+
RUN CGO_ENABLED=1 go build -o spindle cmd/spindle/main.go
14
+
15
+
FROM runtime AS spindle
16
+
ENV SPINDLE_SERVER_DB_PATH=/var/lib/spindle/spindle.db
17
+
RUN addgroup --system --gid 1001 spindle
18
+
RUN adduser --system --uid 1001 spindle
19
+
RUN mkdir -p /var/{lib,log}/spindle
20
+
COPY --from=build-spindle /app/spindle /usr/local/bin/spindle
21
+
EXPOSE 6555
22
+
USER spindle
23
+
VOLUME ["/var/log/spindle", "/var/lib/spindle"]
24
+
RUN echo "$PATH"
25
+
CMD ["/usr/local/bin/spindle/main"]
+12
-33
compose.yml
+12
-33
compose.yml
···
1
1
name: tangled
2
2
services:
3
-
knot:
4
-
image: tubbo/knot:latest
5
-
restart: always
6
-
build:
7
-
target: knot
8
-
ports:
9
-
- 2222:22
10
-
environment:
11
-
- KNOT_SERVER_HOSTNAME
12
-
- KNOT_SERVER_OWNER
13
-
volumes:
14
-
- knot_repos:/home/git/repositories
15
-
- knot_data:/var/lib/tangled
16
-
- knot_keys:/etc/ssh/keys
17
3
spindle:
18
-
image: tubbo/spindle:latest
4
+
build: .
19
5
restart: always
20
-
build:
21
-
target: spindle
6
+
user: "1000:1000"
22
7
environment:
23
-
- SPINDLE_SERVER_HOSTNAME
24
-
- SPINDLE_SERVER_OWNER
8
+
SPINDLE_SERVER_HOSTNAME: "example.com"
9
+
SPINDLE_SERVER_OWNER: "did:plc:jl5dgp7xb34xfqlpywt7kcp5"
10
+
SPINDLE_SERVER_DB_PATH: "/var/lib/spindle/spindle.db"
25
11
volumes:
26
-
- spindle_logs:/var/log/spindle
27
-
- spindle_data:/var/lib/tangled
12
+
- ./spindle_logs:/var/log/spindle
13
+
- ./spindle_data:/var/lib/spindle
28
14
caddy:
29
15
image: caddy:2
30
16
restart: always
31
17
ports:
32
-
- 443:443
33
-
- 443:443/udp
34
-
- 80:80
18
+
- 32234:80
19
+
environment:
20
+
CADDY_EMAIL: "melodicake@disroot.org"
35
21
configs:
36
22
- source: caddyfile
37
23
target: /etc/caddy/Caddyfile
38
24
volumes:
39
-
- caddy_data:/data
40
-
volumes:
41
-
knot_repos:
42
-
knot_data:
43
-
knot_keys:
44
-
spindle_logs:
45
-
spindle_data:
46
-
caddy_data:
25
+
- ./caddy_data:/data
26
+
47
27
configs:
48
28
caddyfile:
49
29
content: |
50
30
{
51
31
email ${CADDY_EMAIL}
52
32
}
53
-
${KNOT_SERVER_HOSTNAME} { reverse_proxy http://knot:5555 }
54
33
${SPINDLE_SERVER_HOSTNAME} { reverse_proxy http://spindle:6555 }
-25
mise.toml
-25
mise.toml
···
1
-
[tools]
2
-
docker-cli = "latest"
3
-
4
-
[settings]
5
-
experimental = true
6
-
7
-
[env]
8
-
_.file = ".env.yaml"
9
-
10
-
[tasks.build]
11
-
description = "Build container images"
12
-
run = "docker bake"
13
-
sources = ["docker-bake.hcl", "Dockerfile"]
14
-
outputs = { auto = true }
15
-
16
-
[tasks.publish]
17
-
description = "Publish container images"
18
-
run = [
19
-
"echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin",
20
-
{ task = "build --push" }
21
-
]
22
-
23
-
[tasks.start]
24
-
description = "Run container services"
25
-
run = "docker compose up"
History
1 round
0 comments
katproto.girlonthemoon.xyz
submitted
#0
merge conflicts detected
expand
collapse
expand
collapse
- Dockerfile:45
- compose.yml:1