Skip to content

Commit 84dddab

Browse files
authored
Merge pull request #1 from Coderx85/feature/docker
feat(docker): refactor Docker setup and enhance documentation
2 parents 914d314 + 748741e commit 84dddab

6 files changed

Lines changed: 355 additions & 20 deletions

File tree

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ FROM node:22.11-slim AS build
22

33
WORKDIR /app
44

5+
LABEL name="Priyanshu"
6+
LABEL version="1.0.0"
7+
LABEL description="Neotion - A Notion Clone"
8+
LABEL maintainer="coderx85"
9+
LABEL email="work.priyanshu085@gmail.com"
10+
LABEL org.opencontainer.image.source="https://github.com/coderx85/neotion"
11+
512
# Add ARG instructions for environment variables
613
ARG NEXT_PUBLIC_CONVEX_URL=https://localhost:3000
714
ARG NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
@@ -52,4 +59,4 @@ LABEL org.opencontainer.immge.source.=https://docker.io/coderx85/neotion
5259

5360
EXPOSE 3000
5461

55-
CMD ["npm","run","docker:run"]
62+
CMD ["npm","run","docker:dev"]

Dockerfile.dev

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
## 📑 Table of Contents
3232

3333
- [🚀 Overview](#-overview)
34-
- [✨ Core Features (The 80/20)](#-core-features-the-8020)
35-
- [🧩 All Features](#-all-features)
34+
- [🧠 Technical Deep Dive](#technical-deep-dive)
35+
- [Features](#features)
3636
- [🖼️ Screenshots](#️-screenshots)
3737
- [🛠️ Tech Stack](#️-tech-stack)
38-
- [📁 Project Structure](#-project-structure)
38+
- [📁 Project Structure](###project-structure)
3939
- [🔧 Installation](#-installation)
4040
- [💻 Usage](#-usage)
4141
- [⚙️ Environment Variables](#️-environment-variables)
@@ -52,9 +52,20 @@ Neotion is a modern, open-source alternative to Notion, designed for users who n
5252
<img src="public/hero.png" alt="Neotion Hero Image" width="700">
5353
</p>
5454

55+
### 🧠 Technical Deep Dive
56+
57+
Curious about the engineering decisions behind Neotion? Check out [`learn.md`](./learn.md) for an in-depth look at:
58+
59+
- **Why we chose Convex** over traditional databases for real-time collaboration
60+
- **How we solved real-time editor synchronization** with TipTap and atomic operations
61+
- **The security architecture** that ensures user data isolation
62+
- **Key lessons learned** from building a collaborative platform
63+
64+
Perfect for developers who want to understand the technical challenges and architectural decisions that make Neotion work.
65+
5566
---
5667

57-
## Core Features
68+
## ✨ Features
5869

5970
This section highlights the key workflows that deliver the most value to our users. Understanding these features will get you up and running with Neotion's core functionality quickly.
6071

@@ -160,6 +171,8 @@ The project follows a standard Next.js App Router structure, with clear separati
160171

161172
## 🔧 Installation
162173

174+
### Method 1: Local Development Setup
175+
163176
1. **Clone the repository:**
164177

165178
```bash
@@ -174,13 +187,41 @@ The project follows a standard Next.js App Router structure, with clear separati
174187
```
175188

176189
3. **Set up environment variables:**
177-
Create a `.env.local` file in the root of the project and add the variables from the table below.
190+
Create a `.env.local` file in the root of the project and add the variables from the [Environment Variables](#️-environment-variables) table below.
178191

179192
4. **Run the development server:**
180193
```bash
181194
npm run dev
182195
```
183196

197+
### Method 2: Docker Hub Deployment
198+
199+
1. **Pull the Docker image:**
200+
201+
```bash
202+
docker pull coderx85/neotion:latest
203+
```
204+
205+
2. **Run the Docker container:**
206+
207+
```bash
208+
docker run -p 3000:3000 \
209+
-e NEXT_PUBLIC_CONVEX_URL="your_convex_url" \
210+
-e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your_clerk_publishable_key" \
211+
-e CLERK_SECRET_KEY="your_clerk_secret_key" \
212+
-e CONVEX_DEPLOYMENT="your_convex_deployment" \
213+
-e EDGE_STORE_ACCESS_KEY="your_edge_store_access_key" \
214+
-e EDGE_STORE_SECRET_KEY="your_edge_store_secret_key" \
215+
coderx85/neotion:latest
216+
```
217+
218+
3. **Access the application:**
219+
Open your browser and navigate to `http://localhost:3000`
220+
221+
**Note:** Replace the placeholder values with your actual environment variables. For easier management, you can create a `.env` file and use `--env-file .env` instead of individual `-e` flags.
222+
223+
---
224+
184225
---
185226

186227
## 💻 Usage

docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
args:
7+
- NEXT_PUBLIC_CONVEX_URL=${NEXT_PUBLIC_CONVEX_URL}
8+
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}
9+
- CLERK_SECRET_KEY=${CLERK_SECRET_KEY}
10+
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
11+
- NEXT_PUBLIC_CLERK_SIGN_IN_URL=${NEXT_PUBLIC_CLERK_SIGN_IN_URL}
12+
- NEXT_PUBLIC_CLERK_SIGN_UP_URL=${NEXT_PUBLIC_CLERK_SIGN_UP_URL}
13+
- NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=${NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL}
14+
- NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=${NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL}
15+
- NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=${NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL}
16+
- NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=${NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL}
17+
- CONVEX_DEPLOYMENT=${CONVEX_DEPLOYMENT}
18+
- EDGE_STORE_ACCESS_KEY=${EDGE_STORE_ACCESS_KEY}
19+
- EDGE_STORE_SECRET_KEY=${EDGE_STORE_SECRET_KEY}
20+
ports:
21+
- "3001:3000"
22+
environment:
23+
- NODE_ENV=development
24+
- PORT=3000
25+
env_file:
26+
- .env.local
27+
depends_on:
28+
- database
29+
30+
database:
31+
image: postgres:latest
32+
ports:
33+
- "5432:5432"
34+
environment:
35+
POSTGRES_USER: user
36+
POSTGRES_PASSWORD: password
37+
POSTGRES_DB: mydatabase

0 commit comments

Comments
 (0)