Deployment Overview of Redmine on Server¶
Prerequisites and Basic Requirements¶
-
Operating System: Linux distribution compatible with Docker.
-
Privileges: Root access or
sudoprivileges are required to manage Docker services and system directories. -
Domain: The deployment utilizes the
hostkey.inzone. -
Ports: The external interface listens on port
443for HTTPS traffic. Port80is 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_secretsvolume, mapped to/etc/letsencryptinside 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.0container namedredmine-mysql. -
Application:
redminecontainer namedredmine. -
Reverse Proxy:
jonasal/nginx-certbot:latestcontainer namedredmine-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 pingto verify database availability. -
Restart Policy:
always -
redmine:
-
Image:
redmine -
Dependencies: Waits for
redmine-mysqlto be healthy. -
Environment Variables: Connects to the
dbservice, uses specific database password and secret key base. -
Health Check: Uses
wgetto spiderhttp://localhost:3000. -
Restart Policy:
always -
redmine-nginx:
-
Image:
jonasal/nginx-certbot:latest -
Dependencies: Waits for the
redminecontainer to be healthy. -
Restart Policy:
unless-stopped -
Environment: Loads certificate email and Nginx configuration from external files.
-
Volumes: Mounts
nginx_secretsfor 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_secretsvolume. -
Server Name: Configured to respond to
redmine<Server ID>.hostkey.in. -
Port Listening: Listens on
443(HTTPS) and80(HTTP). -
Proxy Headers: The Nginx configuration forwards
X-Forwarded-Host,X-Forwarded-Server,X-Real-IP, andX-Forwarded-Forheaders to the backend Redmine container. -
Websocket Support: Configuration includes
UpgradeandConnectionheaders 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
redmineandredmine-mysqlcontainers. -
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_PASSWORDvariable. -
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:
-
Stop the Application:
-
Update or Restart Services:
-
View Logs:
-
Restart Specific Container: