SnipSavvy / SnipSavvy_Frontend

https://snipsavvy.vercel.app
19 stars 31 forks source link

Dockerized the frontend #54

Closed Tanishq1604 closed 1 month ago

Tanishq1604 commented 1 month ago

fixes #53 i have deckerized the frontend for easy setup of the project and also i have the updated readme locally , once this pr gets merged will push it

vercel[bot] commented 1 month ago

@Tanishq1604 is attempting to deploy a commit to the snipsavvy's projects Team on Vercel.

A member of the Team first needs to authorize it.

cb7chaitanya commented 1 month ago

This is alright but I have 2 points as feedback:-

  1. Handling of Environment variables: This is a question regarding your handling of environment variables in the dockerfile itself, wouldn't adding the ENV variables in the docker file itself would lead to changes in the dockerfile from every contributor everytime when setting up the project in a dockerized fashion, there might be a chance a user forgets to remove the environment variables, that would be a leak of private credentials of the user such as the google client ID
  2. Could be more optimized: You can structure your Dockerfile in a much better fashion by utilizing docker layers, as there are many files which will not be changed often in the frontend repository, which you should ideally identify and copy before copying package.json() itself which would give a much better caching result and a faster build time when building the image again, in case of a code updation.

Not merging this for now, work on these points and then will look into merging @Tanishq1604

Tanishq1604 commented 1 month ago

@cb7chaitanya after running the command

docker build -t snipsavvy .

for run the user have to assign the env in the terminal with the docker run command by adding an "-e" so the whole command will look like

docker run -p 3000:3000 \
  -e NEXT_PUBLIC_BASEURL=http://localhost:"Your Backend Url" \
  -e AUTH_GOOGLE_ID="Your Google CLient Id" \
  -e AUTH_GOOGLE_SECRET="Your Google Client Secret" \
  -e NEXTAUTH_URL=http://localhost:3000/api/auth/ \
  -e NEXTAUTH_SECRET="Your Secret Key" \
  snipsavvy

Working on it