Improve deployment documentation and logging
continuous-integration/drone/push Build is passing

Update DOCKER-COMPOSE.md to include Drone CI deployment instructions and refactor server logging to dynamically import modules for production and development environments, separating Vite and static file serving logic into distinct files.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ceced2fc-aa46-458d-ba87-ddd4b7bb1518
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/659922a9-0087-461c-90dd-6d9a58b81d4d/ceced2fc-aa46-458d-ba87-ddd4b7bb1518/SBF5OKZ
This commit is contained in:
paul-nothaft
2025-10-23 14:50:55 +00:00
parent 40f661b39b
commit ed49eb0fce
4 changed files with 133 additions and 4 deletions
+74
View File
@@ -393,6 +393,80 @@ To use an external PostgreSQL database instead of the container:
DATABASE_URL=postgresql://user:password@external-host:5432/taskflow
```
## Deployment via CI/CD (Drone CI)
If you're using Drone CI to build and deploy your Docker images:
### Using Pre-built Images
If your CI system (like Drone) builds the image for you:
1. **Pull the image from your registry:**
```bash
docker pull registry.local.nothaft.cloud/taskflow:latest
```
2. **Create docker-compose.yml for pre-built image:**
```yaml
version: '3.8'
services:
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:-taskflow}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB:-taskflow}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-taskflow}"]
interval: 5s
timeout: 5s
retries: 5
app:
image: registry.local.nothaft.cloud/taskflow:latest # Use pre-built image
ports:
- "${PORT:-5000}:5000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://${POSTGRES_USER:-taskflow}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-taskflow}
- PORT=5000
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
```
3. **Start services:**
```bash
docker-compose up -d
```
### .drone.yml Configuration
Your `.drone.yml` file should build and push to your registry:
```yaml
kind: pipeline
type: docker
name: default
steps:
- name: build taskflow
image: plugins/docker
settings:
repo: registry.local.nothaft.cloud/taskflow
tags: latest
dockerfile: Dockerfile
context: .
registry: registry.local.nothaft.cloud
```
## Support
For issues and questions: