Gokapi
Gokapi copied to clipboard
Documentation: Instructions for customising Gokapi with Docker
hi.. i've tried to find where to customize the DOCKER version under portainer, but i can't find, can you guide me to the position of the configuration files/folder
thanks :D
Hi, thanks for the feedback! I will improve the documentation in that regard, as it is a little bit outdated and does not go too much into detail on how to customise Docker based instances.
You can follow the current documentation found here. As only the minimised versions are used, you have to run go generate ./... or replace the minimised versions instead. Then mount the static folder to /app/static and/or the template folder to /app/templates
i'm tring to copy the file with scp in app/ or /templates in the root directory , but with portainer i think the files are stored somewhere else.. i can't figure how to do :|
in portainer i added the two lines, templates and static
services: gokapi: container_name: Gokapi image: f0rc3/gokapi:latest ports: - 53842:53842 volumes: - /portainer/Files/AppData/Config/gokapi/data:/app/data - /portainer/Files/AppData/Config/gokapi/config:/app/config - /portainer/Files/AppData/Config/gokapi/templates:/app/templates - /portainer/Files/AppData/Config/gokapi/static:/app/static
restart: always
copied the folder from my computer in the same directory of data and config under /portainer/Files/AppData
in the logs i see:
Found folder 'templates', using local folder instead of internal template folder
Found folder 'static', using local folder instead of internal static folder
then i uploaded a new background and modified css to pick the new background
but when i restart the container/server the background don't change
@Raxiel1987 / @Forceu - I have personally added gokapi as a submodule, and then use a Dockerfile like this:
./gokapi/ # <--- submodule
./Dockerfile
./web/ # <--- Contains changed versions of the css and js for company branding purposes
FROM golang:1.22.3-alpine AS build_base
RUN mkdir /compile
COPY ./gokapi/go.mod /compile
RUN cd /compile && go mod download
COPY ./gokapi/ /compile
COPY ./web/ /compile/internal/webserver/web/ # <--- Copy our web folder into the image before the go generate step
RUN cd /compile && go generate ./... && CGO_ENABLED=0 go build -ldflags="-s -w -X 'github.com/forceu/gokapi/internal/environment.IsDocker=true' -X 'github.com/forceu/gokapi/internal/environment.Builder=Project Docker File' -X 'github.com/forceu/gokapi/internal/environment.BuildTime=$(date)'" -o /compile/gokapi github.com/forceu/gokapi/cmd/gokapi
FROM alpine:3.19
RUN addgroup -S gokapi && adduser -S gokapi -G gokapi
RUN apk update && apk add --no-cache su-exec tini ca-certificates curl tzdata && mkdir /app && touch /app/.isdocker
COPY ./gokapi/dockerentry.sh /app/run.sh
COPY --from=build_base /compile/gokapi /app/gokapi
WORKDIR /app
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/app/run.sh"]
HEALTHCHECK --interval=10s --timeout=5s --retries=3 CMD curl --fail http://127.0.0.1:53842 || exit 1
i just changed /themed my installation of gokapi, but i have a question, now i've copied templates and static and configured the path, but if a new version is deployed i have to update the folder aswell? or not?
Sorry I did not see your last reply.
With Gokapi 2.0 (a pre-release is already available) the whole customisation has been changed to additive CSS and JS, you find the documentation here: https://gokapi.readthedocs.io/en/latest/advanced.html#customising
I will therefore close the issue.