Skip to content

Deployment Overview of Redmine on Server

Prerequisites and Basic Requirements

  • Operating System: Linux distribution compatible with Docker.

  • Privileges: Root access or sudo privileges are required to manage Docker services and system directories.

  • Domain: The deployment utilizes the hostkey.in zone.

  • Ports: The external interface listens on port 443 for HTTPS traffic. Port 80 is used for HTTP redirection and Let's Encrypt certificate validation.

Final Access Address

The fully qualified domain name (FQDN) for accessing the Redmine panel follows the format: redmine<Server ID>.hostkey.in:443

Replace <Server ID> with the specific identifier assigned to your server instance. The default path is /.

File and Directory Structure

The application and its related components are organized in the following locations:

  • Application Data and Configuration: /opt/redmine

  • Docker Compose File: /opt/redmine/docker-compose.yml

  • Nginx User Configuration: /data/nginx/user_conf.d/redmine<Server ID>.hostkey.in.conf

  • SSL Certificates: Stored within the nginx_secrets volume, mapped to /etc/letsencrypt inside the Nginx container.

  • Nginx Environment Variables: /data/nginx/nginx-certbot.env

Application Installation Process

Redmine is deployed using Docker containers orchestrated via Docker Compose. The installation includes three primary components:

  • Database: mysql:8.0 container named redmine-mysql.

  • Application: redmine container named redmine.

  • Reverse Proxy: jonasal/nginx-certbot:latest container named redmine-nginx.

The deployment process involves creating the necessary directory structure, generating the docker-compose.yml file with environment variables, and executing the Docker Compose command to start the services.

Docker Containers and Their Deployment

The system utilizes three Docker containers defined in /opt/redmine/docker-compose.yml:

  • redmine-mysql:

  • Image: mysql:8.0

  • Database Name: redmine

  • Health Check: Uses mysqladmin ping to verify database availability.

  • Restart Policy: always

  • redmine:

  • Image: redmine

  • Dependencies: Waits for redmine-mysql to be healthy.

  • Environment Variables: Connects to the db service, uses specific database password and secret key base.

  • Health Check: Uses wget to spider http://localhost:3000.

  • Restart Policy: always

  • redmine-nginx:

  • Image: jonasal/nginx-certbot:latest

  • Dependencies: Waits for the redmine container to be healthy.

  • Restart Policy: unless-stopped

  • Environment: Loads certificate email and Nginx configuration from external files.

  • Volumes: Mounts nginx_secrets for Let's Encrypt certificates and the custom user configuration directory.

Proxy Servers and SSL Configuration

An Nginx reverse proxy handles all incoming traffic and manages SSL termination using Let's Encrypt (Certbot).

  • SSL Configuration: Certificates are automatically generated and stored in the nginx_secrets volume.

  • Server Name: Configured to respond to redmine<Server ID>.hostkey.in.

  • Port Listening: Listens on 443 (HTTPS) and 80 (HTTP).

  • Proxy Headers: The Nginx configuration forwards X-Forwarded-Host, X-Forwarded-Server, X-Real-IP, and X-Forwarded-For headers to the backend Redmine container.

  • Websocket Support: Configuration includes Upgrade and Connection headers to support WebSocket connections.

  • Backend Target: Traffic is proxied to http://redmine:3000.

Databases

The application uses a MySQL 8.0 database running inside a Docker container.

  • Connection Method: Internal Docker network communication between the redmine and redmine-mysql containers.

  • Database Name: redmine

  • Storage: Data is stored within the Docker container's internal volume or the host mount defined by the Docker engine.

  • Credentials:

  • Root Password: Defined by the REDMINE_MYSQL_PASSWORD variable.

  • Database User: root (used for the initial connection and password verification).

Available Ports for Connection

The following ports are exposed on the host server:

  • 443: HTTPS (Secure access to the Redmine interface).

  • 80: HTTP (Used for redirection to HTTPS and SSL certificate renewal challenges).

  • 3000: Internal use only, accessible only from within the Docker network by the Nginx proxy.

Starting, Stopping, and Updating

Service management is performed using Docker Compose commands executed from the /opt/redmine directory.

  • Start the Application:

    cd /opt/redmine
    docker compose up -d
    

  • Stop the Application:

    cd /opt/redmine
    docker compose down
    

  • Update or Restart Services:

    cd /opt/redmine
    docker compose up -d
    

  • View Logs:

    cd /opt/redmine
    docker compose logs -f
    

  • Restart Specific Container:

    docker restart redmine-mysql
    docker restart redmine
    docker restart redmine-nginx
    

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×