|
| 1 | +Certainly! Here's a README for the script that provides an overview of its functionality, usage, and features: |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +# Docker Stack Management Script |
| 6 | + |
| 7 | +This script is designed to manage a Docker stack, particularly for Phraseanet applications. It provides functionalities to start, stop, check, and gather information about the Docker stack, including version checks, log viewing, and environment details. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Start and Stop the Docker Stack**: Easily start or stop your Docker stack with simple commands. |
| 12 | +- **Version Checking**: Verify the compatibility of Docker and Docker Compose versions. |
| 13 | +- **Environment Information**: Gather detailed information about the environment, including Phraseanet installation status, version details, and internal URLs. |
| 14 | +- **Log Viewing**: View logs for all containers or filter logs for a specific container. |
| 15 | +- **Environment Variables**: Load and display environment variables from `.env` and either `env.local` or `.env.local` files. |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +### Prerequisites |
| 20 | + |
| 21 | +- Docker and Docker Compose installed on your system. |
| 22 | +- Appropriate permissions to execute Docker commands. |
| 23 | +- Environment files (`.env`, `env.local`, or `.env.local`) configured with necessary variables. |
| 24 | + |
| 25 | +### Commands |
| 26 | + |
| 27 | +- **Start the Stack**: |
| 28 | + ```bash |
| 29 | + ./manage_docker.sh start |
| 30 | + ``` |
| 31 | + |
| 32 | +- **Stop the Stack**: |
| 33 | + ```bash |
| 34 | + ./manage_docker.sh stop |
| 35 | + ``` |
| 36 | + |
| 37 | +- **Check Versions**: |
| 38 | + ```bash |
| 39 | + ./manage_docker.sh check |
| 40 | + ``` |
| 41 | + |
| 42 | +- **Display Environment Information**: |
| 43 | + ```bash |
| 44 | + ./manage_docker.sh info |
| 45 | + ``` |
| 46 | + |
| 47 | +- **View Logs**: |
| 48 | + - For all containers: |
| 49 | + ```bash |
| 50 | + ./manage_docker.sh log |
| 51 | + ``` |
| 52 | + - For a specific container: |
| 53 | + ```bash |
| 54 | + ./manage_docker.sh log <container_name> |
| 55 | + ``` |
| 56 | + |
| 57 | +### Environment Variables |
| 58 | + |
| 59 | +The script uses the following environment variables, which should be defined in your environment files: |
| 60 | + |
| 61 | +- `PHRASEANET_DOCKER_TAG`: The Docker tag for the Phraseanet image. |
| 62 | +- `PHRASEANET_DOCKER_REGISTRY`: The Docker registry for the Phraseanet image. |
| 63 | +- `PHRASEANET_HOSTNAME`: The hostname for the Phraseanet instance. |
| 64 | +- `PHRASEANET_SCHEME`: The scheme (e.g., `http` or `https`) for the Phraseanet instance. |
| 65 | +- `PHRASEANET_APP_PORT`: The port for the Phraseanet application. |
| 66 | + |
| 67 | +### Notes |
| 68 | + |
| 69 | +- Ensure that the environment files (`.env`, `env.local`, or `.env.local`) are correctly configured with the necessary variables. |
| 70 | +- The script checks for the presence of `config/configuration.yml` to determine if Phraseanet is installed. |
| 71 | +- The script constructs the internal URL of the Phraseanet instance using the environment variables `PHRASEANET_HOSTNAME`, `PHRASEANET_SCHEME`, and `PHRASEANET_APP_PORT`. |
| 72 | + |
0 commit comments