ratemyclient/DOCKER_README.md
Kevin Sivic 9ece312442 Initial commit: RateMyClient™ Phoenix application
Features:
- User registration and authentication with email/password
- Admin login with username-based authentication (separate from regular users)
- Review system for contractors to rate clients
- Star rating system with review forms
- Client identification with private data protection
- Contractor registration with document verification
- Admin dashboard for review management
- Contact form (demo, non-functional)
- Responsive navigation with DaisyUI components
- Docker Compose setup for production deployment
- PostgreSQL database with Ecto migrations
- High Vis color scheme (dark background with safety orange/green)

Admin credentials: username: admin, password: admin123

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:30:50 -05:00

2.7 KiB

RateMyClient - Docker Setup

This guide will help you run the RateMyClient Phoenix application using Docker Compose.

Prerequisites

  • Docker Desktop installed and running
  • Docker Compose (included with Docker Desktop)

Quick Start

  1. Build and start the containers:

    docker-compose up --build
    

    This will:

    • Build the Phoenix application Docker image
    • Start PostgreSQL database
    • Create the database
    • Run migrations
    • Create an admin user
    • Start the Phoenix server
  2. Access the application:

    Open your browser and navigate to: http://localhost:4000

Default Admin Credentials

Useful Commands

Start containers (detached mode)

docker-compose up -d

Stop containers

docker-compose down

View logs

docker-compose logs -f web

Rebuild after code changes

docker-compose up --build

Access the Phoenix console

docker-compose exec web bin/my_first_elixir_vibe_code remote

Run migrations manually

docker-compose exec web bin/my_first_elixir_vibe_code eval "MyFirstElixirVibeCode.Release.migrate()"

Access PostgreSQL

docker-compose exec db psql -U postgres -d my_first_elixir_vibe_code_dev

Volumes

The application uses a persistent volume for PostgreSQL data:

  • postgres_data: Stores database data

To completely reset the database:

docker-compose down -v
docker-compose up --build

Environment Variables

You can customize the application by modifying the environment variables in docker-compose.yml:

  • DATABASE_URL: PostgreSQL connection string
  • SECRET_KEY_BASE: Secret key for Phoenix (generate with mix phx.gen.secret)
  • PHX_HOST: Hostname for the application
  • PORT: Port to run the application on

Troubleshooting

Port already in use

If port 4000 is already in use, change the port mapping in docker-compose.yml:

ports:
  - "8080:4000"  # Access via http://localhost:8080

Database connection issues

Make sure the database container is healthy:

docker-compose ps

Clean rebuild

docker-compose down -v
docker system prune -a
docker-compose up --build

Production Notes

This Docker setup is configured for production use. For actual production deployment:

  1. Change the SECRET_KEY_BASE to a new secure value
  2. Update database credentials in docker-compose.yml
  3. Consider using environment files (.env) instead of hardcoded values
  4. Set up SSL/TLS termination (nginx, traefik, etc.)
  5. Configure proper backup strategies for the database