Server Management with Docker: A Guide to Moving to a Microservices Architecture
In 2024 one of our e-commerce customers called: "Every time we add a new feature to the server, everything breaks — why?" The answer was simple: a monolithic architecture. A single change affects the whole system. 3 months later we moved to Docker. Now they can do 10 deploys a day with zero downtime. In this article we explain what Docker is, why you should move to a microservices architecture and how to get started. Spoiler: it is easier than you think.
What Is Docker and Why Should You Use It?
Docker lets you package your application and all of its dependencies inside a container — an isolated environment that is lighter than a virtual machine and starts faster.
Traditional vs Docker
| Feature |
Traditional (VM) |
Docker Container |
| Startup Time |
30-60 seconds |
1-3 seconds |
| Disk Usage |
10-50 GB |
100-500 MB |
| RAM Overhead |
2-4 GB |
Megabytes |
| Portability |
Hard |
Very easy |
| Isolation |
Full isolation |
Process-level |
Advantages of Docker
- Consistent Environment: No more "it works on my machine" problem
- Fast Deploys: A new version in seconds
- Easy Rollback: Go back to the previous version in 10 seconds
- Resource Efficiency: 50+ containers can run on the same server
- Microservices Architecture: Each service can be scaled independently
A Real Example:
One of our customers split a monolithic PHP application into Docker microservices. Before: 1 update = 2 hours of downtime. Now: 15 deploys a day, zero downtime. Customer satisfaction rose by 40%.
Installing Docker (Ubuntu 24.04)
# Remove old versions
sudo apt remove docker docker-engine docker.io containerd runc
# Add the repository
sudo apt update
sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Docker installation
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add the user to the docker group (to use it without sudo)
sudo usermod -aG docker $USER
newgrp docker
# Test
docker --version
docker run hello-world
Your First Container: Nginx Web Server
# Start an Nginx container
docker run -d -p 80:80 --name web-server nginx
# Explanation:
# -d: Run in the background (detached)
# -p 80:80: Host 80 -> Container 80 port mapping
# --name: Name the container
# nginx: Download the image from Docker Hub
# Show running containers
docker ps
# Follow the logs
docker logs -f web-server
# Open a shell in the container
docker exec -it web-server bash
# Stop the container
docker stop web-server
# Remove the container
docker rm web-server
Dockerfile: Build Your Own Image
A Dockerfile contains the recipe for your Docker image. Example: a simple Node.js application
# Dockerfile
FROM node:18-alpine
# Working directory
WORKDIR /app
# Copy package.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the application code
COPY . .
# Port declaration (for documentation purposes)
EXPOSE 3000
# Start the application
CMD ["node", "app.js"]
# Build the image
docker build -t my-node-app:1.0 .
# Run the container
docker run -d -p 3000:3000 --name node-app my-node-app:1.0
# Test
curl http://localhost:3000
Docker Compose: Multi-Container Applications
Real applications consist of more than one service: web server, database, cache. With Docker Compose you manage them all with a single command.
Example: WordPress + MySQL + Redis
# docker-compose.yml
version: '3.8'
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: wordpress
MYSQL_USER: wpuser
MYSQL_PASSWORD: wppass
volumes:
- db_data:/var/lib/mysql
restart: always
redis:
image: redis:7-alpine
restart: always
wordpress:
image: wordpress:latest
depends_on:
- db
- redis
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wpuser
WORDPRESS_DB_PASSWORD: wppass
WORDPRESS_DB_NAME: wordpress
volumes:
- wp_data:/var/www/html
restart: always
volumes:
db_data:
wp_data:
# Start all services
docker compose up -d
# Follow the logs
docker compose logs -f
# Check the status
docker compose ps
# Stop and remove all services
docker compose down
# Remove the volumes too (caution: data loss!)
docker compose down -v
Go to http://localhost:8080 and the WordPress setup screen will open.
Docker in Production: Best Practices
1. Multi-Stage Build (Reducing Image Size)
# Dockerfile (Multi-stage)
# Stage 1: Build
FROM node:18 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Production
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
CMD ["node", "dist/app.js"]
# Result: 1.2 GB -> 150 MB
2. Health Check
# Dockerfile
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
3. Resource Limits
# docker-compose.yml
services:
app:
image: my-app
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
4. Secrets Management
# .env file (do not add it to Git!)
DB_PASSWORD=super-secret-password
API_KEY=abc123xyz
# docker-compose.yml
services:
app:
env_file:
- .env
5. Log Management
# docker-compose.yml
services:
app:
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
Docker vs Kubernetes: Which Should You Use?
| Feature |
Docker Compose |
Kubernetes |
| Ease of Use |
Easy |
Complex |
| Scale |
Single server |
Multi-node cluster |
| Auto-scaling |
No |
Yes |
| Self-healing |
Manual restart |
Automatic |
| Ideal Use |
Dev/test, SMEs |
Enterprise, high-scale |
Recommendation: If your application has fewer than 10 containers, Docker Compose is enough. If you need 50+ containers across multiple servers, move to Kubernetes.
A Real-World Example: An E-Commerce Platform
The structure of an e-commerce platform that moved to a microservices architecture:
# docker-compose.yml (production)
version: '3.8'
services:
# Nginx reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# Frontend (React)
frontend:
build: ./frontend
environment:
- API_URL=http://api:3000
# API Gateway
api:
build: ./api-gateway
depends_on:
- product-service
- order-service
- user-service
# Microservices
product-service:
build: ./services/products
environment:
- DB_HOST=postgres
order-service:
build: ./services/orders
environment:
- DB_HOST=postgres
user-service:
build: ./services/users
environment:
- DB_HOST=postgres
# Database
postgres:
image: postgres:15
volumes:
- pg_data:/var/lib/postgresql/data
# Cache
redis:
image: redis:7-alpine
# Queue
rabbitmq:
image: rabbitmq:3-management
volumes:
pg_data:
Advantages:
- You can run 5 instances of the product service (high traffic)
- If there is a bug in the order service, you restart only that one
- Each service can be developed by a different team
- Independent deploys (the product team deploys at night, the order team in the morning)
Docker Support at SistemDC
Docker is fully supported on SistemDC servers:
- Docker Pre-Installed: Comes installed on all VPS and Dedicated servers
- Private Registry: You can host your own Docker registry
- GPU Container: NVIDIA Docker runtime (for AI/ML)
- Managed Kubernetes: Launching in Q2 2026
Docker Consulting: If you want to move your monolithic application to microservices, we offer a free architecture analysis. We provide support with the migration plan, container strategy and DevOps processes.
Modernise with Docker
Do you want to move your application to Docker? Contact us for a free consultation.
Contact:
satis@sistemdc.com
Corporate WhatsApp: +90 224 334 02 42
Conclusion: Time to Move to Docker
Docker has become a cornerstone of modern software development. In 2026, a team that does not use Docker falls behind the competition.
We have served hundreds of customers over 14 years. What we have seen in the last 3 years: teams that move to Docker deploy 300% faster, downtime falls by 80% and developer satisfaction rises.
You do not need a complex system to get started. Start with a single service, learn, expand. The Docker journey begins the moment you start your first container.
Note: The commands in this article have been tested with Docker 25.x and Docker Compose v2. Always add security and monitoring in production. The examples are for educational purposes; follow best practices in production use.