Deployment Overview of Redmine on Server¶
Prerequisites and Basic Requirements¶
The following requirements must be met on the server before accessing the deployed application:
-
Operating System: Linux distribution compatible with Docker Engine.
-
Privileges: Root access or
sudoprivileges are required to manage Docker containers and system services. -
Domain: The application is configured to operate under the
hostkey.inzone. -
Ports: External access is provided via port
443(HTTPS) and port80(HTTP for SSL redirection).
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN) format:
redmine<Server ID>.hostkey.in:443
Replace <Server ID> with the specific identifier assigned to the server instance.
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration, data, and certificates:
-
/opt/redmine: Contains the Docker Compose configuration file. -
/data/nginx/user_conf.d: Stores the Nginx server block configuration files. -
/etc/letsencrypt: Stores SSL certificates and keys managed by Certbot. -
/data/nginx/nginx-certbot.env: Environment file for Nginx-Certbot configuration.
Application Installation Process¶
The application is deployed using Docker containers orchestrated via Docker Compose. The installation includes the following components:
-
Database: MySQL version
8.0. -
Application: Redmine (default image).
-
Proxy: Nginx with Certbot integration (
jonasal/nginx-certbot:latest).
The deployment is initiated by running the Docker Compose command within the /opt/redmine directory.
Docker Containers and Their Deployment¶
The system consists of three primary containers defined in the docker-compose.yml file located at /opt/redmine/docker-compose.yml.
| Container Name | Image | Description |
|---|---|---|
redmine-mysql | mysql:8.0 | Database service for Redmine. |
redmine | redmine | Main Redmine application service. |
redmine-nginx | jonasal/nginx-certbot:latest | Reverse proxy and SSL termination. |
The containers are configured with the following restart policies:
-
redmine-mysql:always -
redmine:always -
redmine-nginx:unless-stopped
Dependencies are enforced such that the redmine container starts only after redmine-mysql is healthy, and redmine-nginx starts only after redmine is healthy.
Proxy Servers¶
The application uses an Nginx reverse proxy container (redmine-nginx) to handle incoming traffic.
-
SSL/TLS: Enabled via Let's Encrypt certificates managed by Certbot.
-
Certificate Path: Certificates are mounted from the
nginx_secretsvolume to/etc/letsencrypt. -
Configuration: The server block is defined in
/data/nginx/user_conf.d/redmine<Server ID>.hostkey.in.conf. -
Proxy Settings:
-
Listens on port
443(SSL) and80. -
Forwards traffic to the Redmine container at
http://redmine:3000. -
Supports WebSocket upgrades.
-
Headers
X-Forwarded-Host,X-Forwarded-Server,X-Real-IP, andX-Forwarded-Forare passed to the backend.
Databases¶
The application uses a MySQL database for data storage.
-
Connection Method: Internal Docker network communication.
-
Database Name:
redmine -
Host:
db(internal container name) -
Authentication: Managed via environment variables (
MYSQL_ROOT_PASSWORD,REDMINE_DB_PASSWORD). -
Health Check: The database container runs a health check using
mysqladmin pingevery 30 seconds.
Available Ports for Connection¶
The following ports are exposed for external and internal communication:
-
Port 443: HTTPS traffic (Primary access).
-
Port 80: HTTP traffic (Used for SSL redirection and Let's Encrypt validation).
-
Port 3000: Internal port used by the Redmine container (not exposed externally).
Starting, Stopping, and Updating¶
Service management is handled via Docker Compose commands executed in the /opt/redmine directory.
-
Start/Restart Services:
-
Stop Services:
-
View Logs:
-
Update Images: To update the application, pull the latest images and restart the containers:
Location of Configuration Files and Data¶
Key configuration files and data locations are as follows:
-
Docker Compose:
/opt/redmine/docker-compose.yml -
Nginx Configuration:
/data/nginx/user_conf.d/redmine<Server ID>.hostkey.in.conf -
SSL Certificates:
/etc/letsencrypt/live/redmine<Server ID>.hostkey.in/ -
Nginx Environment:
/data/nginx/nginx-certbot.env
Permission Settings¶
The deployment directories and files are owned by the root user and group with the following permissions:
-
/opt/redmine:0644(Directory created with root ownership). -
/opt/redmine/docker-compose.yml:0644. -
/data/nginx/user_conf.d/*.conf:0644.