    # Undersign-TMX

## Docker Maintenance & Operational Commands

This section documents common Docker maintenance commands used during application support, 
upgrades, database changes, and environment troubleshooting.

### Container Lifecycle Management
1. Start all services
    ````
    docker compose up -d
    ````

Starts application and database containers in detached mode.

2. Stop and remove containers (safe)
   ```
   docker compose down
    ```
*    Stops containers
* Removes containers and networks
* Does NOT remove database data (volumes preserved)

3. docker compose down
    ```
   docker compose restart
    ```
Useful after configuration changes or temporary failures.

4. Rebuild containers (after Dockerfile or entrypoint changes)
    ``
### Database Maintenance Operations
1. Access MySQL container
    ```
   docker exec -it tmx-db mysql -u tmxuser -p   
    ```
2. Backup database (recommended before changes)
    ```
   docker exec tmx-db mysqldump -u tmxuser -p esign > esign_backup.sql
   ```
3. Restore database
    ```
   docker exec -i tmx-db mysql -u tmxuser -p esign < esign_backup.sql
    ```
   
### Laravel Application Maintenance
Clear configuration cache
````
docker exec -it tmx-app php artisan config:clear
````

Clear application cache
````
docker exec -it tmx-app php artisan cache:clear
````

### Logs & Debugging
View application logs
````
docker exec -it tmx-app tail -n 100 storage/logs/laravel.log
````

View Apache error logs
````
docker exec -it tmx-app tail -n 100 /var/log/apache2/error.log
````

View container startup logs
````
docker logs tmx-app
````
Useful for debugging entrypoint or startup issues.


### Environment & Configuration Changes
After changing .env
Always run:
````
docker exec -it tmx-app php artisan config:clear
````

If .env is auto-managed via entrypoint, this runs automatically on container restart.

### Health Verification Checklist
After any maintenance:
````
docker ps
````

Ensure:
* tmx-app → running
* tmx-db → running


This maintenance guide ensures safe handling of:
* Database updates
* Cache & config issues
* Container lifecycle operations

It enables consistent, repeatable support across development, staging, and production environment


Clenan all
sudo docker compose down --volumes --remove-orphans
docker rmi -f $(docker images -q)


http://3.133.6.201:8080/forgot_password
http://3.133.6.201:8080/login
http://3.133.6.201:8080/dashboard


docker exec -it tmx-app tail -n 100 storage/logs/laravel.log
