-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #337 from captableinc/debug
feat: getting deployable version ready with docker and env changes
- Loading branch information
Showing
125 changed files
with
1,252 additions
and
2,153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,16 @@ | |
# Next.js environment variables | ||
NODE_ENV="development" | ||
NEXT_PUBLIC_NODE_ENV="development" | ||
BASE_URL="http://localhost:3000" | ||
NEXT_PUBLIC_BASE_URL="http://localhost:3000" | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line to disable telemetry at run time | ||
NEXT_TELEMETRY_DISABLED=1 | ||
# Disable telemetry at run time | ||
NEXT_TELEMETRY_DISABLED=1 # Injected in Dockerfile | ||
|
||
# Prisma | ||
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env | ||
DATABASE_URL="postgres://captable:[email protected]:54321/captable" | ||
DATABASE_URL="postgres://captable:password@pg:5432/captable" | ||
|
||
# Next Auth | ||
# You can generate a new secret on the command line with: | ||
# https://next-auth.js.org/configuration/options#secret | ||
|
||
# openssl rand -base64 32 | ||
# Run `openssl rand -base64 32` to generate a new secret | ||
NEXTAUTH_SECRET="xxxxxxxxxx" | ||
NEXTAUTH_URL="http://localhost:3000" | ||
|
||
|
@@ -36,24 +30,13 @@ GOOGLE_CLIENT_ID="xxxxxxxxxx" | |
GOOGLE_CLIENT_SECRET="xxxxxxxxxx" | ||
|
||
# SMTP | ||
EMAIL_SERVER_HOST="localhost" | ||
EMAIL_SERVER_PORT=1025 | ||
EMAIL_SERVER_USERNAME="captable" | ||
EMAIL_SERVER_PASSWORD="password" | ||
EMAIL_SERVER_SECURE=0 | ||
# EMAIL_SERVER=smtp://captable:[email protected]:2500 | ||
EMAIL_FROM=[email protected] | ||
EMAIL_FROM="'Captable, Inc.' <[email protected]>" | ||
EMAIL_SERVER=smtp://captable:password@localhost:1025 | ||
|
||
# Uploads | ||
UPLOAD_PROVIDER="s3" | ||
UPLOAD_ENDPOINT="http://127.0.0.1:9002" | ||
NEXT_PUBLIC_UPLOAD_DOMAIN="http://127.0.0.1:9002" | ||
|
||
# value should be 'auto' while using r2 | ||
UPLOAD_REGION="us-east-1" | ||
UPLOAD_REGION="us-east-1" # value should be 'auto' while using r2 | ||
UPLOAD_ACCESS_KEY_ID="captable" | ||
UPLOAD_SECRET_ACCESS_KEY="password" | ||
|
||
UPLOAD_BUCKET_PUBLIC="captable-public-bucket" | ||
UPLOAD_BUCKET_PRIVATE="captable-private-bucket" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,90 @@ If you like to self-host Captable, Inc., please schedule a call with us, and we | |
|
||
- **Official Docker Images**: | ||
- <a href="https://hub.docker.com/r/captable/captable" target="_blank">Docker hub</a> | ||
- <a href="https://github.com/captableinc/captable/pkgs/container/captable" target="_blank">Github registry</a> | ||
<!-- - <a href="https://github.com/captableinc/captable/pkgs/container/captable" target="_blank">Github registry</a> --> | ||
|
||
- **Environment Variables**:\ | ||
Following envrionment variables are required | ||
|
||
```bash | ||
NODE_ENV="production" | ||
DATABASE_URL="postgres://user:password@host:port/dbname" | ||
NEXTAUTH_SECRET="xxx" # Generated by `openssl rand -base64 32` | ||
NEXTAUTH_URL="https://your-domain.com" | ||
NEXT_PUBLIC_BASE_URL="https://your-domain.com" | ||
|
||
# Email server environment variables | ||
EMAIL_FROM="[email protected]" | ||
|
||
# Please use encrypted/TLS connection for SMTP server. | ||
EMAIL_SERVER="smtp://username:password@host:port" | ||
|
||
# File uplod environment variables | ||
UPLOAD_REGION="us-west-1" # auto when using Cloudflare R2 | ||
UPLOAD_ENDPOINT="https://xxx.r2.cloudflarestorage.com" | ||
UPLOAD_ACCESS_KEY_ID="xxx" | ||
UPLOAD_SECRET_ACCESS_KEY="xxx" | ||
UPLOAD_BUCKET_PUBLIC="public-bucket-name" | ||
UPLOAD_BUCKET_PRIVATE="private-bucket-name" | ||
``` | ||
|
||
- **Run the docker container**: | ||
|
||
```bash | ||
docker run -d \ | ||
-e NODE_ENV="replace" \ | ||
-e DATABASE_URL="replace" \ | ||
-e NEXTAUTH_SECRET="replace" \ | ||
-e NEXTAUTH_URL="replace" \ | ||
-e NEXT_PUBLIC_BASE_URL="replace" \ | ||
-e EMAIL_FROM="replace" \ | ||
-e EMAIL_SERVER="replace" \ | ||
-e UPLOAD_REGION="replace" \ | ||
-e UPLOAD_ENDPOINT="replace" \ | ||
-e UPLOAD_ACCESS_KEY_ID="replace" \ | ||
-e UPLOAD_SECRET_ACCESS_KEY="replace" \ | ||
-e UPLOAD_BUCKET_PUBLIC="replace" \ | ||
-e UPLOAD_BUCKET_PRIVATE="replace" \ | ||
-p 3000:3000 \ | ||
captable/captable | ||
``` | ||
|
||
- **Setup CORS for file uploads**:\ | ||
Some of the services including Cloudflare R2 may require you to setup CORS for file uploads.\ | ||
|
||
> Here is an sample CORS configuration for Cloudflare R2. | ||
```json | ||
[ | ||
{ | ||
"AllowedOrigins": [ | ||
"https://your-domain.com" | ||
], | ||
"AllowedMethods": [ | ||
"HEAD", | ||
"GET", | ||
"POST", | ||
"PUT", | ||
"DELETE" | ||
], | ||
"AllowedHeaders": [ | ||
"*" | ||
] | ||
} | ||
] | ||
``` | ||
|
||
- **Run database migrations**: | ||
|
||
```bash | ||
docker exec -it <container_id> npx prisma migrate deploy | ||
``` | ||
|
||
<!-- Ready --> | ||
- **Access the application**:\ | ||
Open your browser and navigate to `https://your-domain.com` | ||
|
||
- **Questions?**\ | ||
If you have any questions, please schedule a call with us, and we will help you set up your own instance. | ||
|
||
<a href="https://captable.inc/schedule/"><img alt="Book us" src="https://cal.com/book-with-cal-dark.svg" /></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.