diff options
| author | lost+skunk <[email protected]> | 2024-11-26 12:26:13 +0000 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-11-26 12:26:13 +0000 |
| commit | e9de48656d61aecb8d90dd4f14395964d72f36ac (patch) | |
| tree | 3375b108f4e9c4580dbc73b8f05e2549025ac261 | |
| parent | f692d1eb2d99e9a5c8030b196729a9fe896bb328 (diff) | |
| parent | 86203ebb7b37e8f14f8fbed31710d07f37d2b473 (diff) | |
| download | skunky-art-e9de48656d61aecb8d90dd4f14395964d72f36ac.tar.gz skunky-art-e9de48656d61aecb8d90dd4f14395964d72f36ac.tar.bz2 skunky-art-e9de48656d61aecb8d90dd4f14395964d72f36ac.zip | |
Merge pull request 'Docker' (#6) from vlnst/SkunkyArt:Docker into master
Reviewed-on: https://git.macaw.me/skunky/SkunkyArt/pulls/6
| -rw-r--r-- | .dockerignore | 6 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Dockerfile | 23 | ||||
| -rw-r--r-- | compose.example.yaml | 12 |
4 files changed, 42 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6833fbe --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +cache +compose.yaml +*.json +LICENSE +*.md +services @@ -1,4 +1,5 @@ **/cache +**/compose.yaml **/config.json **/skunkyart **/skunkyart-* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fdc1919 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +ARG GO_VERSION=1.18 + +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /build +COPY . . +RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" && \ + echo "skunkyart:x:10000:10000:SkunkyArt user:/:/sbin/nologin" > /etc/minimal-passwd && \ + echo "skunkyart:x:10000:" > /etc/minimal-group + +FROM scratch + +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=build /build/static /static +COPY --from=build /build/skunkyart /skunkyart +COPY --from=build /etc/minimal-passwd /etc/passwd +COPY --from=build /etc/minimal-group /etc/group + +USER skunkyart + +ENTRYPOINT ["/skunkyart"] diff --git a/compose.example.yaml b/compose.example.yaml new file mode 100644 index 0000000..5eead70 --- /dev/null +++ b/compose.example.yaml @@ -0,0 +1,12 @@ +services: + skunkyart: + container_name: skunkyart + restart: unless-stopped + build: . + ports: + - "127.0.0.1:3003:3003" + security_opt: + - no-new-privileges:true + volumes: + - ./config.json:/config.json:ro + - ./cache:/cache # Ensure cache folder has a 10000:10000 ownership. |
