<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.soylentnews.org/index.php?action=history&amp;feed=atom&amp;title=Docker_Administration</id>
	<title>Docker Administration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.soylentnews.org/index.php?action=history&amp;feed=atom&amp;title=Docker_Administration"/>
	<link rel="alternate" type="text/html" href="https://wiki.soylentnews.org/index.php?title=Docker_Administration&amp;action=history"/>
	<updated>2026-04-18T22:09:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://wiki.soylentnews.org/index.php?title=Docker_Administration&amp;diff=56427&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;&lt;markdown&gt; # Quick Start Guide to Docker DevOps Infrastructure  ## Overview This guide provides a comprehensive quick start for administrators to set up and manage our Docker-based DevOps infrastructure. The system leverages Docker and a host machine, with each service folder containing a `docker-compose.yml` file that defines the necessary services.  ## Folder Structure - **/opt/servicename**: This directory is used for persistent data storage for each service. Replace...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.soylentnews.org/index.php?title=Docker_Administration&amp;diff=56427&amp;oldid=prev"/>
		<updated>2024-11-24T23:26:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;markdown&amp;gt; # Quick Start Guide to Docker DevOps Infrastructure  ## Overview This guide provides a comprehensive quick start for administrators to set up and manage our Docker-based DevOps infrastructure. The system leverages Docker and a host machine, with each service folder containing a `docker-compose.yml` file that defines the necessary services.  ## Folder Structure - **/opt/servicename**: This directory is used for persistent data storage for each service. Replace...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;markdown&amp;gt;&lt;br /&gt;
# Quick Start Guide to Docker DevOps Infrastructure&lt;br /&gt;
&lt;br /&gt;
## Overview&lt;br /&gt;
This guide provides a comprehensive quick start for administrators to set up and manage our Docker-based DevOps infrastructure. The system leverages Docker and a host machine, with each service folder containing a `docker-compose.yml` file that defines the necessary services.&lt;br /&gt;
&lt;br /&gt;
## Folder Structure&lt;br /&gt;
- **/opt/servicename**: This directory is used for persistent data storage for each service. Replace `servicename` with the actual name of the service.&lt;br /&gt;
- **/secrets/${ENVIRONMENT}.env**: This file contains environment-specific secrets. Replace `${ENVIRONMENT}` with the appropriate environment name (e.g., `production`, `staging`).&lt;br /&gt;
- **/secrets/${ENVIRONMENT}/${SERVICENAME}.env**: This file contains service-specific secrets for a given environment. Replace `${ENVIRONMENT}` with the environment name and `${SERVICENAME}` with the name of the service.&lt;br /&gt;
&lt;br /&gt;
## Prerequisites&lt;br /&gt;
- **Docker**: Ensure Docker is installed and running on your host machine. You can download and install Docker from [here](https://www.docker.com/get-started).&lt;br /&gt;
- **Docker Compose**: Basic knowledge of Docker and Docker Compose is required. Docker Compose should also be installed. You can find the installation instructions [here](https://docs.docker.com/compose/install/).&lt;br /&gt;
- **Utility Scripts**: The scripts located in the `./util` directory should be added to your system's PATH. Run the `install-util.sh` script to achieve this. This script will ensure that the utility scripts are accessible from any location in your terminal.&lt;br /&gt;
&lt;br /&gt;
## Setting Up Services&lt;br /&gt;
&lt;br /&gt;
1. **Create Persistent Data Folder**:&lt;br /&gt;
   - Create a directory in `/opt/servicename` to store persistent data for each service. Replace `servicename` with the actual name of the service.&lt;br /&gt;
   - Ensure this folder is included in your backup script (`./backup.sh`) to maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
2. **Manage Secrets**:&lt;br /&gt;
   - Store environment-specific secrets in `/secrets/${ENVIRONMENT}/${SERVICENAME}.env`. Replace `${ENVIRONMENT}` with the appropriate environment name (e.g., `production`, `staging`) and `${SERVICENAME}` with the name of the service.&lt;br /&gt;
   - Reference these environment variables in your `docker-compose.yml` file to securely pass secrets to your services.&lt;br /&gt;
&lt;br /&gt;
3. **Configure Docker Compose**:&lt;br /&gt;
   - Use volumes in your `docker-compose.yml` file to mount configuration files from `/opt/servicename/` to the appropriate locations within your containers.&lt;br /&gt;
   - Utilize Traefik labels in your `docker-compose.yml` file to map URLs to the corresponding service IPs and ports for proper routing.&lt;br /&gt;
&lt;br /&gt;
4. **Template Replacement**:&lt;br /&gt;
   - Files with a `.template` extension will undergo string substitution, replacing placeholders like `{{ENV-VAR-NAME}}` with the corresponding environment variable values.&lt;br /&gt;
   - Use the `setup-env` script to set environment variables and run necessary hooks. The `dc` command will handle this process for you.&lt;br /&gt;
&lt;br /&gt;
## Running Services&lt;br /&gt;
- **Start/Stop Services**:&lt;br /&gt;
  - Use `dc up` to start services.&lt;br /&gt;
  - Use `dc down` to stop services.&lt;br /&gt;
  - `dc` is an alias for `compose.sh`.&lt;br /&gt;
&lt;br /&gt;
## Exiisting Services&lt;br /&gt;
- **/traefik: Web frontend and SSL proxy.&lt;br /&gt;
- **/rehash: Basic setup including MariaDB and Sphinx.&lt;br /&gt;
- **/rehash-dev**: Testing environment for rehash.&lt;br /&gt;
- **/ircd**: Solanum IRCD and Atheme services.&lt;br /&gt;
&lt;br /&gt;
## Environment Setup Details from `compose.sh` and `setup-env.sh`&lt;br /&gt;
&lt;br /&gt;
1. **Load Environment Variables**:&lt;br /&gt;
   - Environment variables are loaded from multiple sources in the following order of increasing priority:&lt;br /&gt;
     - `./.env`&lt;br /&gt;
     - `/secrets/${ENVIRONMENT}.env`&lt;br /&gt;
     - `/secrets/${ENVIRONMENT}/${SERVICENAME}.env`&lt;br /&gt;
     - `./.env` (loaded again to override any previous values)&lt;br /&gt;
&lt;br /&gt;
2. **Execute Pre-Hook Script**:&lt;br /&gt;
   - The `pre-hook.sh` script is run to perform any necessary setup before processing templates. This can include tasks such as generating changes to the templates based on the environment variables.&lt;br /&gt;
&lt;br /&gt;
3. **Process and Replace Templates**:&lt;br /&gt;
   - Templates are processed and filled with the appropriate values, including any secrets. Once filled, these templates are moved to the `/opt` directory.&lt;br /&gt;
&lt;br /&gt;
4. **Execute Post-Hook Script**:&lt;br /&gt;
   - The `post-hook.sh` script is run to perform any final setup tasks before the Docker container is started. This typically involves moving secret-filled files from the devops home folder to the `/opt` directory to ensure they are in the correct location for the container.&lt;br /&gt;
&lt;br /&gt;
## Commands&lt;br /&gt;
&lt;br /&gt;
- **Start or Stop All Services**:&lt;br /&gt;
  - To start all services, use the following command:&lt;br /&gt;
    ```sh&lt;br /&gt;
    dc up&lt;br /&gt;
    ```&lt;br /&gt;
  - This command is equivalent to:&lt;br /&gt;
    ```sh&lt;br /&gt;
    docker compose up -d --force-recreate&lt;br /&gt;
    ```&lt;br /&gt;
  - It will start all services defined in the `docker-compose.yml` file in detached mode and recreate containers if necessary.&lt;br /&gt;
&lt;br /&gt;
  - To stop all services, use the following command:&lt;br /&gt;
    ```sh&lt;br /&gt;
    dc down&lt;br /&gt;
    ```&lt;br /&gt;
  - This command is equivalent to:&lt;br /&gt;
    ```sh&lt;br /&gt;
    docker compose down&lt;br /&gt;
    ```&lt;br /&gt;
  - It will stop and remove all containers defined in the `docker-compose.yml` file.&lt;br /&gt;
&lt;br /&gt;
- **Start or Stop a Specific Service**:&lt;br /&gt;
  - To start a specific service, use the following command:&lt;br /&gt;
    ```sh&lt;br /&gt;
    dc up [SERVICE_NAME] [EXTRA_ARGS]&lt;br /&gt;
    ```&lt;br /&gt;
  - This command is equivalent to:&lt;br /&gt;
    ```sh&lt;br /&gt;
    docker compose up --force-recreate &amp;quot;$SERVICE_NAME&amp;quot; $EXTRA_ARGS&lt;br /&gt;
    ```&lt;br /&gt;
  - Replace `[SERVICE_NAME]` with the name of the service you want to start and `[EXTRA_ARGS]` with any additional arguments.&lt;br /&gt;
&lt;br /&gt;
  - To stop a specific service, use the following command:&lt;br /&gt;
    ```sh&lt;br /&gt;
    dc down [SERVICE_NAME] [EXTRA_ARGS]&lt;br /&gt;
    ```&lt;br /&gt;
  - This command is equivalent to:&lt;br /&gt;
    ```sh&lt;br /&gt;
    docker compose down --force-recreate &amp;quot;$SERVICE_NAME&amp;quot; $EXTRA_ARGS&lt;br /&gt;
    ```&lt;br /&gt;
  - Replace `[SERVICE_NAME]` with the name of the service you want to stop and `[EXTRA_ARGS]` with any additional arguments.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
## Conclusion&lt;br /&gt;
This guide provides a structured approach to setting up and managing services in our Docker-based infrastructure. Follow the steps and examples to get started quickly.&lt;br /&gt;
&amp;lt;/markdown&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>