File tree 4 files changed +56
-10
lines changed
4 files changed +56
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Add your DB connection string in Database URL
2
2
# To use and access media files, set up cloudinary and add the details in below keys
3
- DATABASE_URL = " postgresql://postgres:mypassword@localhost :5432/postgres"
4
- CLOUDINARY_CLOUD_NAME =
5
- CLOUDINARY_API_KEY =
6
- CLOUDINARY_API_SECRET =
3
+ DATABASE_URL = " postgresql://postgres:mypassword@db :5432/postgres"
4
+ CLOUDINARY_CLOUD_NAME = your_cloud_name
5
+ CLOUDINARY_API_KEY = your_api_key
6
+ CLOUDINARY_API_SECRET = your_api_secret
Original file line number Diff line number Diff line change 5
5
<h3 align =" center " >ByteNotes</h3 >
6
6
7
7
<p align =" center " >
8
- The open-source Google Keep and Evernote alike software .
8
+ The open-source notes making application with features like collaboration in real time and much more .
9
9
<br />
10
10
<a href="https://akshayshinde.com"><strong>Learn more »</strong></a>
11
11
<br />
@@ -62,3 +62,16 @@ We love our contributors! Here's how you can contribute:
62
62
- [ Open an issue] ( https://github.com/alphacoder-mp3/ByteNotes/issues ) if you believe you've encountered a bug.
63
63
- Follow the [ local development guide] ( https://ByteNotes/docs/local-development ) to get your local dev environment set up.
64
64
- Make a [ pull request] ( https://github.com/alphacoder-mp3/ByteNotes/pull ) to add new features/make quality-of-life improvements/fix bugs.
65
+
66
+ ### For Local Development (with existing PostgreSQL)
67
+
68
+ 1 . Copy ` .env.example ` to ` .env ` and update with your local PostgreSQL and Cloudinary credentials.
69
+ 2 . Update the ` DATABASE_URL ` in ` docker-compose.yml ` to use ` host.docker.internal ` instead of ` db ` .
70
+ 3 . Run ` docker-compose -f docker/docker-compose.yml up --build `
71
+
72
+ ### For Remote Users or Fresh Setup
73
+
74
+ 1 . Copy ` .env.example ` to ` .env ` and update with your Cloudinary credentials.
75
+ 2 . Run ` docker-compose -f docker/docker-compose.yml up --build `
76
+
77
+ The app will be available at http://localhost:3000
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ FROM node:20.12.0-alpine3.19
2
2
3
3
WORKDIR /app
4
4
5
- # Copy package.json and package-lock.json
6
5
COPY package*.json yarn.lock tsconfig.json components.json next.config.mjs postcss.config.mjs tailwind.config.ts ./
7
6
8
7
COPY prisma ./prisma/
@@ -14,9 +13,6 @@ RUN npx prisma generate
14
13
15
14
COPY . .
16
15
17
- RUN npm run build
18
-
19
-
20
16
EXPOSE 3000
21
17
22
- CMD ["npm" , "start " ]
18
+ CMD ["npm" , "run" , "dev " ]
Original file line number Diff line number Diff line change
1
+ version : ' 3.8'
2
+
3
+ services :
4
+ app :
5
+ build :
6
+ context : ..
7
+ dockerfile : docker/Dockerfile
8
+ ports :
9
+ - " 3000:3000"
10
+ environment :
11
+ - DATABASE_URL=postgresql://postgres:mypassword@db:5432/postgres
12
+ - CLOUDINARY_CLOUD_NAME=${CLOUDINARY_CLOUD_NAME}
13
+ - CLOUDINARY_API_KEY=${CLOUDINARY_API_KEY}
14
+ - CLOUDINARY_API_SECRET=${CLOUDINARY_API_SECRET}
15
+ volumes :
16
+ - ..:/app
17
+ - /app/node_modules
18
+ depends_on :
19
+ - db
20
+ command : sh -c "
21
+ npx prisma migrate deploy &&
22
+ npm run dev
23
+ "
24
+
25
+ db:
26
+ image: postgres:13
27
+ environment:
28
+ - POSTGRES_USER=postgres
29
+ - POSTGRES_PASSWORD=mypassword
30
+ - POSTGRES_DB=postgres
31
+ ports:
32
+ - " 5433:5432"
33
+ volumes :
34
+ - postgres_data:/var/lib/postgresql/data
35
+
36
+ volumes :
37
+ postgres_data:
You can’t perform that action at this time.
0 commit comments