rubynor / bigfive-web

Website for taking personality tests
https://bigfive-test.com
MIT License
372 stars 146 forks source link

Add a dockerfile for easier development #105

Closed maccyber closed 3 months ago

maccyber commented 1 year ago

ref https://github.com/rubynor/bigfive-web/issues/102 I also needed to do some tricks to bypass the 50mb limit on vercel functions but I think they have no use for a PR right now

karate commented 1 year ago

Hello. Would you be interested in doing this with docker-compose instead of plain docker?

maccyber commented 1 year ago

Sure :-)

Rovel commented 1 year ago

I also needed to do some tricks to bypass the 50mb limit on vercel functions but I think they have no use for a PR right now

I also have some tricks already in my sleeve @maccyber, if you remove the skip questions as dev in the index and store the files goes below 50mb but again no use for a PR

I also built a dockerfile / compose to work in a container, but as mentioned in other issues the API folder project does not work outside vercel, so you need at least a first deploy so your local can use those functions in vercel cloud, or point those to the actual running rubynor backend, but if you do that there is no use for a db since you are using rubynor db too.

I yall like I can open the Dockerfile PR, since is already done in my local.

karate commented 1 year ago

Running the app locally, I noticed that results are still being sent and fetched from/to https://bigfive-test.com. This seems to be hardcoded in https://github.com/rubynor/bigfive-web/blob/master/nuxt.config.js#L293

I'd suggest to first fix the app to respect the process.env.NODE_ENV variable as it is suggested here: https://github.com/rubynor/bigfive-web/blob/master/lib/helpers.js#L36 in a different PR.

As a result, I'm committing a docker-compose file only for the container with the node image, as there is no point in starting a mongo container if it's not being used. If you don't want to merge this, please feel free to close the PR.