Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Instructions for customising Gokapi with Docker #190

Open
Raxiel1987 opened this issue Jul 16, 2024 · 4 comments
Open

Documentation: Instructions for customising Gokapi with Docker #190

Raxiel1987 opened this issue Jul 16, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@Raxiel1987
Copy link

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

@Forceu Forceu changed the title customize Documentation: Instructions for customising Gokapi with Docker Jul 16, 2024
@Forceu Forceu added the documentation Improvements or additions to documentation label Jul 16, 2024
@Forceu
Copy link
Owner

Forceu commented Jul 16, 2024

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

@Raxiel1987
Copy link
Author

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 :|

@Raxiel1987
Copy link
Author

Raxiel1987 commented Jul 17, 2024

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

@MalteMagnussen
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants