Open toyo2333 opened 3 months ago
Have you looked at using override in systemd? See https://askubuntu.com/a/659268/1657026. systemd supports both cgroups and namespace v2 to lock down the process' access.
It is not too hard to run Goatcounter in Docker - here's my Dockerfile, to be run with vendor/goatcounter
populated with the source:
FROM golang:1.23 AS build
COPY vendor/goatcounter /go/src/goatcounter
WORKDIR /go/src/goatcounter
RUN CGO_ENABLED=0 \
go build \
-tags osusergo,netgo,sqlite_omit_load_extension \
-ldflags="-X zgo.at/goatcounter.Version=2.5.0" \
./cmd/goatcounter
FROM scratch
COPY --from=build /go/src/goatcounter/goatcounter /goatcounter
ENTRYPOINT ["/goatcounter"]
CMD ["serve", "-automigrate", "-listen", ":8081", "-tls", "proxy", "-email-from", "nobody@localhost", "-db", "postgresql"]
Then use PG* variables to set the database parameters. There are complaints about not being able to use port 80, but the higher port still works.
I understand that the author has previously expressed multiple times that Docker deployment will not be supported (because the current deployment method is already simple enough).
However, I still want to explain from a user's perspective why we hope to have Docker support: One GoatCounter is indeed very simple, but when you have 10-20 GoatCounters with different installation methods, data storage, update methods, and backup methods, it’s not so simple anymore.
At this point, the benefits of using Docker Compose become apparent: consistency in data storage and program management. Let me share my example:
1、All my projects are deployed using Docker and are placed in one directory:
I’m writing this mainly to explain the reasoning behind this request, nothing more.