Skip to content

Commit

Permalink
Chore/add dev env scripts for rebuiling frontend easily (#43)
Browse files Browse the repository at this point in the history
* adds dev docker scripts

* refine commands and add to readme
  • Loading branch information
mathewmorris authored Jan 6, 2025
1 parent 688dd67 commit 761c46a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@
npx vercel env pull
```

- run `docker compose up -d`
- run application using docker
```bash
npm run dev:docker
```

The frontend next application will be ready for connections at `localhost:3000`.
The postgres database will be ready for connections at `localhost:5432`.

## Some important scripts

The app should be exposed at `localhost:3000` ready for development.
|command|description|
|-|-|
|`npm run rebuild-frontend`|Will rebuild the next application and start it up without triggering a database rebuild|
|`npm run dev:docker`|starts dev environment via docker|
|`npm run dev:logs`|starts reading docker compose log files for application container|

## What happens when I push a new branch to Github?
1. Vercel [creates a Preview deployment](https://vercel.com/magicians/magic-vault/deployments)
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"build": "next build",
"postinstall": "prisma generate",
"dev": "next dev",
"dev:docker": "docker compose up -d",
"dev:logs": "docker compose logs -f",
"rebuild-frontend": "docker compose up -d --build next-app",
"lint": "next lint",
"start": "next start",
"test": "SKIP_ENV_VALIDATION=true jest",
Expand Down

0 comments on commit 761c46a

Please sign in to comment.