Skip to content

fleet-at-app/fleetat-fe-deploy

Repository files navigation

FleetAt Production Deployment

Production deployment configuration for FleetAt application using Docker Compose.

🔒 Security Notice

NEVER commit these files to Git:

  • .env (contains real secrets)
  • caddy/Caddyfile.prod (contains real domain)

Only commit template files:

  • .env.*.example
  • caddy/Caddyfile.prod.example

Prerequisites

  • Docker & Docker Compose V2+ installed
  • Domain name pointed to your server (A record)
  • Ports 80, 443, 2019 open in firewall
  • Sufficient disk space (recommend 20GB+)

Quick Start

Local Development

  1. Run development script
    ./scripts/deploy-dev.sh
    This script will create your .env from template and ensure all local data directories exist before starting the services.

Production: Automated Deployment (Recommended)

  1. Clone and navigate
    git clone <your-repo-url>
    cd fleetat-deploy
  2. Run deployment script
    ./scripts/deploy-prod.sh

The script will:

  • Create .env from template (if missing)
  • Create Caddyfile.prod from template (if missing)
  • Prompt you to edit configuration
  • Check for placeholder values
  • Ensure required Docker volumes exist
  • Pull Docker images
  • Start services

Production: Manual Deployment

  1. Clone repository
    git clone <your-repo-url>
    cd fleetat-deploy
  2. Create production volumes
    docker volume create db-data
    docker volume create discovery-data
    docker volume create shell-data
    docker volume create caddy-data
    docker volume create caddy-config
  3. Configure environment
    cp .env.prod.example .env
    nano .env # Edit and set secure values
  4. Configure Caddy
    cp caddy/Caddyfile.prod.example caddy/Caddyfile.prod
    nano caddy/Caddyfile.prod # Set your domain
  5. Deploy
    docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

Configuration

Environment Variables (.env)

Required variables in .env:

  • BE_VERSION: Backend image version
  • FE_VERSION: Frontend image version
  • SPRING_PROFILES_ACTIVE: Spring profile (prod or dev)
  • POSTGRES_DB: Database name
  • POSTGRES_USER: Database user
  • POSTGRES_PASSWORD: Database password (32+ chars)
  • REGISTRATION_SECRET: API secret (32+ chars)
  • DOMAIN: Your actual domain

Local Volume Paths (Development)

For local development, you can customize the host paths used for bind mounts in .env:

  • POSTGRES_DATA_PATH: Local path for database data (default: ./data/postgres)
  • DISCOVERY_DATA_PATH: Local path for discovery server data (default: ./data/discovery)
  • SHELL_DATA_PATH: Local path for shell data (default: ./data/shell)
  • CADDY_DATA_PATH: Local path for Caddy's internal data (default: ./data/caddy-data)
  • CADDY_CONFIG_PATH: Local path for Caddy's configuration (default: ./data/caddy-config)

Note: Production uses named volumes for better data management and persistence.

Generate secure passwords:

openssl rand -base64 32

Project Structure

fleetat-deploy/
├── .env.example              # Template for development
├── .env.prod.example         # Template for production
├── .env.dev.example          # Template for local development
├── .gitignore                # Protects secrets
├── docker-compose.yml        # Base compose file (shared)
├── docker-compose.override.yml # Local development overrides
├── docker-compose.prod.yml   # Production overrides
├── scripts/                  # Deployment scripts
│   ├── deploy-dev.sh         # Local development script
│   └── deploy-prod.sh        # Production deployment script
├── README.md                 # This file
├── caddy/
│   ├── Caddyfile             # Development config (HTTP only)
│   └── Caddyfile.prod.example # Production template (HTTPS)
└── nginx/
    └── nginx.conf            # Alternative to Caddy (not used)

Maintenance

View Logs

# Production
docker-compose -f docker-compose.yml -f docker-compose.prod.yml logs -f

# Local
docker-compose logs -f

Check Service Health

# Production
docker-compose -f docker-compose.yml -f docker-compose.prod.yml ps

# Local
docker-compose ps

Backup Database

docker exec fleetat_db pg_dump -U fleetat_prod fleetat_prod > backup-$(date +%Y%m%d-%H%M%S).sql

Security Best Practices

  • Use strong passwords (32+ characters)
  • Keep .env file permissions restricted: chmod 600 .env
  • Regularly update Docker images
  • Never commit .env to Git

About

Fleet AT Deploy files for docker compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages