Commit 86203ebb7b
86203ebb7b37e8f14f8fbed31710d07f37d2b473
parent: f692d1eb2d
Unregistered key
vlnst <vlnst@bloat.cat> · 2024-11-25 23:32 UTC
Add Docker
Layout: unified · split
.dockerignore
added
+6
| @@ -0,0 +1,6 @@ |
| |
1 | cache |
| |
2 | compose.yaml |
| |
3 | *.json |
| |
4 | LICENSE |
| |
5 | *.md |
| |
6 | services |
.gitignore
+1
| @@ -1,4 +1,5 @@ |
| 1 | **/cache |
1 | **/cache |
| |
2 | **/compose.yaml |
| 2 | **/config.json |
3 | **/config.json |
| 3 | **/skunkyart |
4 | **/skunkyart |
| 4 | **/skunkyart-* |
5 | **/skunkyart-* |
Dockerfile
added
+23
| @@ -0,0 +1,23 @@ |
| |
1 | ARG GO_VERSION=1.18 |
| |
2 | |
| |
3 | FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build |
| |
4 | ARG TARGETOS |
| |
5 | ARG TARGETARCH |
| |
6 | |
| |
7 | WORKDIR /build |
| |
8 | COPY . . |
| |
9 | RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" && \ |
| |
10 | echo "skunkyart:x:10000:10000:SkunkyArt user:/:/sbin/nologin" > /etc/minimal-passwd && \ |
| |
11 | echo "skunkyart:x:10000:" > /etc/minimal-group |
| |
12 | |
| |
13 | FROM scratch |
| |
14 | |
| |
15 | COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ |
| |
16 | COPY --from=build /build/static /static |
| |
17 | COPY --from=build /build/skunkyart /skunkyart |
| |
18 | COPY --from=build /etc/minimal-passwd /etc/passwd |
| |
19 | COPY --from=build /etc/minimal-group /etc/group |
| |
20 | |
| |
21 | USER skunkyart |
| |
22 | |
| |
23 | ENTRYPOINT ["/skunkyart"] |
compose.example.yaml
added
+12
| @@ -0,0 +1,12 @@ |
| |
1 | services: |
| |
2 | skunkyart: |
| |
3 | container_name: skunkyart |
| |
4 | restart: unless-stopped |
| |
5 | build: . |
| |
6 | ports: |
| |
7 | - "127.0.0.1:3003:3003" |
| |
8 | security_opt: |
| |
9 | - no-new-privileges:true |
| |
10 | volumes: |
| |
11 | - ./config.json:/config.json:ro |
| |
12 | - ./cache:/cache # Ensure cache folder has a 10000:10000 ownership. |