Skip to content

Commit

Permalink
Make --frozen-lockfile be supplied to yarn install everywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantbh committed Oct 22, 2024
1 parent b24c2d1 commit 1a8f1ec
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ RUN apt-get update && \
&& chmod 0644 /etc/cron.d/cronjob \
&& crontab /etc/cron.d/cronjob \
&& cd /app/web-server \
&& yarn install --network-timeout 1000000 && yarn build \
&& yarn install --frozen-lockfile --network-timeout 1000000 && yarn build \
&& rm -rf ./artifacts \
&& cd /app/ \
&& tar cfz web-server.tar.gz ./web-server \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ RUN crontab /etc/cron.d/cronjob
RUN /app/setup_utils/generate_config_ini.sh -t /app/backend/analytics_server/mhq/config

WORKDIR /app/web-server
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --frozen-lockfile


ENV POSTGRES_DB_ENABLED=true
Expand Down
42 changes: 42 additions & 0 deletions web-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Middleware HQ - Manager Dash

Improve your engineering team productivity. Consistently.

Next.js, Typescript, Redux (+RTK), Knex (postgres), MaterialUI

## Development

1. Acquire the environment variable files. Store them in .local_envs dir at the project root. If you received multiple files, such as `.env.common`, `.env.local`, and `.env.staging`, store them inside the .local_envs dir. If you received something like a `local_envs.zip`, create a folder called `.local_envs`, and extract the contents of the zip within in.

2. Run `yarn env`. This will generate a `.env.local` file in the project root.

3. Acquire the private key file from a team member, and save it as ~/.ssh/jump_server_pk.

4. Export an environment variable in your .bashrc/.zshrc file called `$STAGE_TUNNEL`. Ask a team member on how to define this.

5. Run commands:
```
yarn install --frozen-lockfile
yarn stage-tun
```


## Notes

**HTTPS Server**
Use `yarn https` to start.
Naturally, auth and cookies are separate for the HTTP and HTTPS server.
If you were developing using `yarn dev` and then switched to `yarn https`, you'll need to login again. But since it's still pointing to staging, the data on the UI would remain the same.

**Slack**
If working with Slack integration linking logic, use `yarn https`.
However, if working with the Slack Bot API request/response logic, use `yarn dev` and then use `ngrok` or something.

**Logrocket**
LR operates over a nextjs rewrite path.
However, a rewrite from an HTTP path to an HTTPS path is not supported, hence unless you're using `yarn https`, LR won't work locally even if you tried.

If you must run it locally, do the following:
1. In `src/components/AppHead.tsx`, remove the check that prevents LR from running.
2. Run `yarn https`.
3. Once the app loads, LR should work as expected over the rewrite path.

0 comments on commit 1a8f1ec

Please sign in to comment.