Deploying Apollo Configuration Center with Docker
Prerequisites
Before starting, verify that Docker Engine is installed and running on your system. You can check the Docker version using:
docker --version
If Docker is not installed, download it from the official Docker web site and follow the installation instructions for your operating system.
Pulling Apollo Images
Apollo provides official container images for its core services. Pull the required images from Docker Hub:
docker pull apollodata/apollo-config-service
docker pull apollodata/apollo-portal
For a complete setup, you may also need:
docker pull apollodata/apollo-admin-service
docker pull mysql:5.7
Deployment Methods
Single-Node Deployment with Docker Compose
Create a docker-compose.yml file with the following structure:
version: '3.8'
services:
apollo-db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: ApolloConfigDB
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
config-service:
image: apollodata/apollo-config-service
ports:
- "8080:8080"
depends_on:
- apollo-db
portal-service:
image: apollodata/apollo-portal
ports:
- "8070:8070"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://apollo-db:3306/ApolloConfigDB
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: rootpassword
depends_on:
- apollo-db
volumes:
db-data:
Start all services with:
docker-compose up -d
Database Initialization
If using an external MySQL instance, create the required databases before starting Apollo:
CREATE DATABASE ApolloConfigDB DEFAULT CHARACTER SET utf8mb4;
CREATE DATABASE ApolloPortalDB DEFAULT CHARACTER SET utf8mb4;
Import the schema files located in the Apollo GitHub repository's scripts/sql directory into these databaess.
Service Verification
Check the status of running containers:
docker ps
View logs for a specific container:
docker logs -f <container_id>
Access the Apollo Portal interface by navigating to:
http://localhost:8070
Default login credentials:
- Username: apollo
- Password: admin
Network Configuration
Ensure the following ports are accessible:
| Service | Default Port |
|---|---|
| Portal | 8070 |
| Config Service | 8080 |
| Admin Service | 8090 |
| MySQL | 3306 |
If running in a cloud environment, configure security groups or firewall rules to allow traffic on these ports.
Stopping Services
To stop all Apollo services:
docker-compose down
To remove all data volumes:
docker-compose down -v