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

Self hosting doesn't work out of the box #83

Open
Madjarx opened this issue Nov 1, 2023 · 6 comments
Open

Self hosting doesn't work out of the box #83

Madjarx opened this issue Nov 1, 2023 · 6 comments

Comments

@Madjarx
Copy link

Madjarx commented Nov 1, 2023

Hey guys, i tried running the self hosted version of featmap cus i used the free trial and liked it very much. But it seems that your configuration just desn't work. I managed to get it running but i did some workarounds. So far so good. I'm going to open the pull request, some versions need to be downgraded cus theres peer dependencies, dockerfile for the featmap itself needs to be changed, etc.
I'm gonna be opening a PR with the solution or providing my own framework if you guys are not maintaining this

@JohannesGandhi
Copy link

Hi,
I'm also struggling to host featmap myself. I'm trying to run the docker image. I tried the official one from dockerhub as well as followed the instructions to build the image myself - even though I had to use the branch from #69 to build it without errors. In both cases I only get the following in the log and the container doesn't start:

2023/11/01 16:58:23 invalid argument
2023/11/01 16:58:23 no conf.json found

I don't understand how/where to provide the conf.json. I'm now to docker, so it might be a rookie mistake. Do you have that step figured out?

@Madjarx
Copy link
Author

Madjarx commented Nov 1, 2023

i managed to get it working, if you want me to show you how, we could do a call of a sort or something

@Madjarx
Copy link
Author

Madjarx commented Nov 1, 2023

and its relatively simple

@JohannesGandhi
Copy link

Can you provide the answer here, for everyone to see? Maybe it can be part of that PR as well.

@Madjarx
Copy link
Author

Madjarx commented Nov 1, 2023

YEah im turning it into a template, its a part of my yet-to-be boilerplate for js projects.
My idea was to create a one-script-setup env for new projects that have featmap, staging/prod/local envs, monitoring / ci/cd setup already etc.

But i could maybe give it a bit of time and make it into its own template, just the featmap

But other than that. the fix includes:

Changing the dockerfile to this, note the changes with the golang versions and nodejs

FROM golang:1.15-alpine
WORKDIR /src
RUN apk add --update npm git
# RUN go get -u github.com/jteeuwen/go-bindata/...
RUN go get -u github.com/go-bindata/go-bindata/...
# RUN go install github.com/go-bindata/go-bindata@latest
COPY ./webapp/package.json webapp/package.json
RUN cd ./webapp && \
    npm install
COPY . .
RUN cd ./webapp && \
    npm run build
RUN cd ./migrations && \
    go-bindata  -pkg migrations .
RUN go-bindata  -pkg tmpl -o ./tmpl/bindata.go  ./tmpl/ && \
    go-bindata  -pkg webapp -o ./webapp/bindata.go  ./webapp/build/...    

RUN go build -o /opt/featmap/featmap && \
    chmod 775 /opt/featmap/featmap

ENTRYPOINT cd /opt/featmap && ./featmap

Other than that i was also getting an error when trying to build the dockerfiles with docker-compose build, there was an error with typescript, so i fixed it by adding this line to the tsconfig.json within the ./webapp directory
"noEmitOnError": false,

I also had to downgrade the history version to the 4.7.2 one, make sure to downgrade it too

And also important note, before you run any build scripts or anything, make sure to cd into ./webapp and run npm install, it may give you errors about cache or something but make sure to install it, cus otherwise the docker build process doesnt work for whatever reason

@JohannesGandhi
Copy link

The build process works fine for me with the dockerfile from #69.
Still, I built again using your dockerfile (replacing npm install with npm ci and reintroducing the package-lock.json). Before building I copied the conf.json to /featmap, /featmap/webapp and /featmap/webapp/src and I STILL get the no conf.json found message in the log. The invalid argument however disappeared.

What are you doing differently regarding the conf.json? I cannot see where this issue would be addressed in your dockerfile.

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

No branches or pull requests

2 participants