main
Martinhal Contact Management System - Docker Setup
🐳 Docker Installation (Recommended)
Prerequisites
- Docker installed: https://docs.docker.com/get-docker/
- Docker Compose installed (usually comes with Docker Desktop)
Quick Start with Docker
- Make sure you have all files in the same directory:
martinhal-contacts/
├── Dockerfile
├── docker-compose.yml
├── .dockerignore
├── index.html
├── credentials.json
├── server.js
├── package.json
└── contacts_data.json (will be created automatically)
- Build and start the container:
docker-compose up -d
-
Access the application: Open your browser and go to:
http://localhost:8000 -
Stop the application:
docker-compose down
- View logs:
docker-compose logs -f
Docker Commands Reference
Start the application:
docker-compose up -d
Stop the application:
docker-compose down
Restart the application:
docker-compose restart
View logs:
docker-compose logs -f martinhal-contacts
Rebuild after code changes:
docker-compose down
docker-compose build
docker-compose up -d
Access container shell:
docker exec -it martinhal-contacts sh
📦 Data Persistence
Docker volumes ensure your data persists:
- contacts_data.json - Your contact database (automatically backed up)
- backups/ - Directory for backup files
Even if you delete and recreate containers, your data remains safe!
🔄 Updating the Application
- Update your files (index.html, server.js, etc.)
- Rebuild and restart:
docker-compose down
docker-compose build
docker-compose up -d
🔐 Current Passwords
- Frontend Password:
ZaAhdf4h8k79598pHD5H3 - Backend Username:
admin - Backend Password:
yt33PdH9WgAGR5z4SFDf6
🛠 Troubleshooting
Port 8000 already in use:
Edit docker-compose.yml and change the port mapping:
ports:
- "3000:8000" # Access via http://localhost:3000
Container won't start:
docker-compose logs martinhal-contacts
Remove everything and start fresh:
docker-compose down
docker system prune -a
docker-compose up -d
📋 Alternative: Manual Setup (No Docker)
If you don't want to use Docker:
Step 1: Install Node.js
Download from: https://nodejs.org/
Step 2: Install Dependencies
npm install
Step 3: Start Server
npm start
Step 4: Open Browser
http://localhost:8000
🎯 Production Deployment
For production deployment with Docker:
- Use environment variables for sensitive data
- Set up HTTPS with reverse proxy (nginx)
- Configure automated backups
- Set resource limits in docker-compose.yml
Example production docker-compose.yml:
version: '3.8'
services:
martinhal-contacts:
build: .
container_name: martinhal-contacts
ports:
- "8000:8000"
volumes:
- ./contacts_data.json:/app/contacts_data.json
- ./backups:/app/backups
restart: always
environment:
- NODE_ENV=production
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
✅ Benefits of Docker
- ✅ Consistent environment - Works the same everywhere
- ✅ Easy deployment - One command to start
- ✅ Isolated - Doesn't interfere with other apps
- ✅ Easy updates - Rebuild and restart
- ✅ Data persistence - Your data is safe
- ✅ Easy backups - Just copy the volume
That's it! Your Martinhal Contact Management System is now running in Docker! 🎉
Languages
HTML
86.2%
JavaScript
13.8%