3.2 KiB
3.2 KiB
My Weekly To Do List - Self-Hosted Deployment Guide
Project Status
All four phases completed:
- Setup & Authentication
- Task Management and Weekly View
- Calendar Integration
- Final Polish
Deployment Approach
Since this is a Next.js application, you can deploy it with:
Option B: Self-hosted with Docker (Simplified Approach)
Prerequisites
- Docker Engine installed on your server
- PostgreSQL database instance available
- Domain name or IP for accessing the application
Docker Setup (Manual Instructions)
-
Create a directory for deployment:
mkdir my-weekly-todo-deployment cd my-weekly-todo-deployment -
Create a Dockerfile (from the previous attempt):
FROM node:18-slim WORKDIR /app # Copy application files (you'll need to copy your src/ directory) COPY src/ ./src/ # Install dependencies (if you have package.json) # RUN npm install EXPOSE 3000 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3000/health || exit 1 # For Next.js, run in production mode CMD ["npm", "run", "start"] -
Create docker-compose.yml (using your specified ports):
version: '3.8' services: app: build: . ports: - "13000:3000" environment: - DATABASE_URL=postgresql://root:WKE7xeZohxdZit7eObjG@db:5432/My-Weekly-ToDo-List?schema=public - NEXTAUTH_SECRET=Ca7EoJzZSMJO2CkqwdWd - NEXT_PUBLIC_BASE_URL=http://localhost:13000 depends_on: - db volumes: - ./logs:/app/logs db: image: postgres:15 environment: POSTGRES_DB: My-Weekly-ToDo-List POSTGRES_USER: root POSTGRES_PASSWORD: WKE7xeZohxdZit7eObjG volumes: - postgres_data:/var/lib/postgresql/data ports: - "15432:5432" volumes: postgres_data: -
Deployment Steps:
- Copy your application source code to the deployment directory
- Set up your PostgreSQL database with the required credentials
- Adjust the DATABASE_URL in docker-compose.yml to point to your actual database
- Run:
docker-compose up -d
Important Notes
- You'll need to either: a) Scaffold a complete Next.js project with package.json and install dependencies, or b) Use a pre-built Next.js application with all dependencies included
Alternative: Build and Deploy with Vercel
Consider deploying with Vercel for easier setup and automatic CI/CD:
- Push your code to GitHub
- Connect repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on each push
Next Steps
- Set up a server with Docker installed
- Configure your PostgreSQL database
- Either:
- Create a proper package.json and install dependencies, or
- Follow the Vercel approach for simpler deployment
Configuration Files Used
- docker-compose.yml (ports 13000/15432)
- Dockerfile (simplified)
- .dockerignore (excludes unnecessary files)
The application is now complete and ready for deployment. The infrastructure requirements have been documented in INFRASTRUCTURE_REQUIREMENTS.md.