imrovise the docker compose setup

This commit is contained in:
Puru D
2024-06-04 02:36:11 -05:00
parent 330deeb079
commit 0f5ef6ce70
5 changed files with 65 additions and 53 deletions
+3
View File
@@ -10,6 +10,9 @@
# should be updated accordingly.
# Next.js environment variables
NODE_ENV="development"
NODE_VERSION="20.10.0"
NEXT_PUBLIC_NODE_ENV="development"
NEXT_PUBLIC_BASE_URL="http://localhost:3000"
# Disable telemetry at run time
+2
View File
@@ -52,3 +52,5 @@ yarn-error.log*
/prisma/enums.ts
/.pnpm-store
+10 -16
View File
@@ -2,7 +2,6 @@
<img alt="Captable, Inc. cover image" src="https://captable.inc/og.png">
</a>
<h1 align="center">Captable, Inc.</h1>
<p align="center">
#1 Open-source Cap table management platform, an alternative to Carta, Pulley, Angelist and others.
@@ -54,14 +53,12 @@
✅ **Data rooms** - Captable, Inc. provides a secure virtual data room where you can store important documents and share them with investors, employees, and other stakeholders.
<h2 id="community">🤝 Community</h2>
We have a community of developers, designers, and entrepreneurs who are passionate about building the future of finance. Join us on Discord to connect with like-minded individuals, share your ideas, and collaborate on projects.
* [Join us on Discord](https://discord.gg/rCpqnD6G6p)
* [Follow us on Twitter](https://twitter.com/captableinc)
* [Meet the Founder](https://captable.inc/schedule)
- [Join us on Discord](https://discord.gg/rCpqnD6G6p)
- [Follow us on Twitter](https://twitter.com/captableinc)
- [Meet the Founder](https://captable.inc/schedule)
<h2 id="contributing">🫡 Contributing</h2>
@@ -70,7 +67,6 @@ We have a community of developers, designers, and entrepreneurs who are passiona
- Let's collaborate on [Discord](https://discord.gg/rCpqnD6G6p) community channel.
- Any contributions you make are truly appreciated.
<h3 id="stack">Stack</h3>
- [Next.js](https://nextjs.org)
@@ -87,7 +83,6 @@ When contributing to <strong>Captable, Inc.</strong>, whether on GitHub or in ot
- Be respectful, civil, and open-minded.
- Before opening a new pull request, try searching through the [issue tracker](https://github.com/captableinc/captable/issues) for known issues or fixes.
<h3 id="setup">Setup development environment</h3>
- <a href="#gitpod">Development environment on Gitpod</a>
@@ -110,38 +105,37 @@ When contributing to <strong>Captable, Inc.</strong>, whether on GitHub or in ot
- Copy `.env.example` to `.env`
```bash
cp .env.example .env`
cp .env.example .env
```
- Run the following command to start the development environment
```bash
# With pnpm installed
pnpm dx
# Without pnpm installed
docker compose up
```
- Run the following command to migrate and seed the database
```bash
docker compose run app pnpm db:migrate
docker compose run app pnpm db:seed
```
> **Note**
> Everytime you make changes to Dockerfile.dev or compose.yml, you need to rebuild the docker image by running `docker compose up --build`
- Running `docker compose up` will start all the services on their respective ports.
- App will be running on [http://localhost:3000](http://localhost:3000)
- Emails will be intercepted: [http://localhost:8025](http://localhost:8025)
- SMTP will be on PORT `http://localhost:1025`
- Postgres will be on PORT `http://localhost:5432`
- Prisma studio will be on PORT `http://localhost:5555`
- Frequently used commands
- `docker compose up` - Start the development environment
@@ -237,4 +231,4 @@ Thanks for your contributions. Much ❤️
---
![Alt](https://repobeats.axiom.co/api/embed/a8fc8a167d33eec78a71953a2b9e58985ca4b3b6.svg "Captable repo activity")
![Alt](https://repobeats.axiom.co/api/embed/a8fc8a167d33eec78a71953a2b9e58985ca4b3b6.svg "Captable repo activity")
+42 -29
View File
@@ -1,5 +1,25 @@
name: captable
services:
app:
image: node:${NODE_VERSION}-alpine
container_name: captable-app
depends_on:
- pg
- smtp
- minio
restart: always
ports:
- 3000:3000
env_file:
- ".env"
working_dir: /app
command: [/bin/sh, -c, "npm i -g [email protected] && pnpm install && pnpm dev"]
volumes:
- .:/app
- /app/node_modules
- /app/.next
- /app/.pnpm-store
pg:
image: postgres:15
container_name: captable-database
@@ -11,7 +31,7 @@ services:
ports:
- 54321:5432
volumes:
- postgres:/var/lib/postgresql/data
- postgres:/var/lib/postgresql/data
smtp:
image: axllent/mailpit
@@ -19,6 +39,7 @@ services:
ports:
- 8025:8025
- 1025:1025
minio:
image: minio/minio
container_name: captable-minio
@@ -33,40 +54,32 @@ services:
entrypoint: sh
command: -c 'minio server /data --console-address ":9001" --address ":9002"'
app:
build:
context: .
dockerfile: ./docker/Dockerfile.dev
container_name: captable-app
restart: always
ports:
- 3000:3000
env_file:
- ".env.example"
- ".env"
volumes:
- .:/app
- /app/node_modules
- /app/.next
depends_on:
- pg
- smtp
- minio
# minio client - is expected to be run once to setup minio buckets. It'll exit 0 after setup
mc:
image: minio/mc
container_name: captable-minio-client
entrypoint: sh
command: -c "
mc alias set myminio http://minio:9002 captable password;
mc mb myminio/captable-private-bucket;
mc mb myminio/captable-public-bucket;
mc policy set public myminio/captable-public-bucket;
exit 0;
"
depends_on:
- minio
entrypoint: sh
command: |
-c "
sleep 10;
mc alias set myminio http://minio:9002 captable password;
mc mb myminio/captable-private-bucket;
mc mb myminio/captable-public-bucket;
mc policy set public myminio/captable-public-bucket;
exit 0;
"
adminer:
image: adminer
container_name: captable-adminer
ports:
- 8080:8080
depends_on:
- pg
environment:
- ADMINER_DESIGN=nette
- ADMINER_DEFAULT_SERVER=pg
volumes:
minio:
+8 -8
View File
@@ -305,7 +305,7 @@ importers:
version: 9.2.22
knip:
specifier: ^5.17.2
version: 5.17.3(@types/[email protected])([email protected])
version: 5.17.4(@types/[email protected])([email protected])
lint-staged:
specifier: ^15.2.2
version: 15.2.2
@@ -4332,8 +4332,8 @@ packages:
resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==}
engines: {node: '>= 8'}
[email protected].3:
resolution: {integrity: sha512-x2paKB0BOzFjnetYolGwg9Dwa8ZIYwBuVP2V4bWRFfTeLs7BymARb7I00R3OCbr09gKKr8TPLQVx2GQ6RF9llQ==}
[email protected].4:
resolution: {integrity: sha512-D6dQjauc3ZIPq0jTYgTeuxpeDKVOaV84S5TNeBDB2GjoPQVzEPW7PA83XijyGXNrflWq4zvWNn49gTUN0Lfeig==}
engines: {node: '>=18.6.0'}
hasBin: true
peerDependencies:
@@ -6004,8 +6004,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
[email protected].1:
resolution: {integrity: sha512-O5O/RbdV3CjhtwFa4slXvrb/26lzsf4/NMts3QFIRniIsi+584QSneJXaHXasqcZO+B7pWZkr+4h9knhnAQevg==}
[email protected].2:
resolution: {integrity: sha512-cBL4xF2A3lSINV4rD5tyqnKH4z/TgWPvT+NaVhJDSwK962oo/Ye7cHSMbDzwcu7tAE1SfU6Q4XtV6Hucmi6Hlw==}
[email protected]:
resolution: {integrity: sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==}
@@ -11638,7 +11638,7 @@ snapshots:
[email protected]: {}
[email protected].3(@types/[email protected])([email protected]):
[email protected].4(@types/[email protected])([email protected]):
dependencies:
'@ericcornelissen/bash-parser': 0.5.2
'@nodelib/fs.walk': 2.0.0
@@ -12635,7 +12635,7 @@ snapshots:
real-require: 0.2.0
safe-stable-stringify: 2.4.3
sonic-boom: 4.0.1
thread-stream: 3.0.1
thread-stream: 3.0.2
[email protected]: {}
@@ -13744,7 +13744,7 @@ snapshots:
dependencies:
any-promise: 1.3.0
[email protected].1:
[email protected].2:
dependencies:
real-require: 0.2.0