-
Section 1: Introduction
-
Section 2: Docker Basics for Beginners
-
Section 3: VPS — Rent Your Own Server
-
Section 4: Running Varyshop in Docker
-
Section 5: Building Your Website and Lead Magnet Page
-
Section 6: CRM — Managing Your Contacts and Leads
-
Section 7: Mass Communication — Email & SMS Marketing
-
Section 8: Conclusion and Next Steps
Docker Compose — Your Entire System in One File
Docker Compose
Your entire system in one file
Docker Compose lets you define and run multi-container applications with a single YAML file. Instead of running separate docker commands for each service, you describe everything in one place and start it all with one command.
Why Docker Compose
Single Source of Truth
All your services, networks, and volumes are defined in one file. No more remembering complex docker run commands.
Reproducible Deployments
The same file works everywhere. Share it with your team, commit it to Git, use it in CI/CD.
Service Dependencies
Define which services depend on which. Compose starts them in the correct order.
Anatomy of docker-compose.yml
services:
db:
image: postgres:16
environment:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo_secret
POSTGRES_DB: postgres
volumes:
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
odoo:
image: odoo:18
depends_on:
- db
ports:
- "8069:8069"
environment:
HOST: db
USER: odoo
PASSWORD: odoo_secret
volumes:
- odoo-data:/var/lib/odoo
restart: unless-stopped
volumes:
pgdata:
odoo-data:Key Sections Explained
services
Each service is a container. Here we define two: db for PostgreSQL and odoo for the application.
image
Which Docker image to use. The tag after the colon specifies the version.
environment
Environment variables passed into the container. Used for database credentials, host names, and configuration.
volumes
Named volumes that persist data. Defined per service and declared globally at the bottom.
depends_on
Tells Compose to start the database before the application.
restart
The unless-stopped policy restarts containers automatically after crashes or server reboots.
Essential Commands
docker compose up -d # Start all services in background docker compose ps # List running containers docker compose logs -f # Follow live logs docker compose down # Stop and remove containers docker compose pull # Pull latest images
docker compose down vs stop
The down command removes containers and networks. The stop command only stops them. Use stop for temporary pauses, down for clean restarts. Volumes are preserved in both cases.
One File, Full Stack
Docker Compose transforms a complex multi-service deployment into a single readable file and a single command. This is the foundation of your Varyshop deployment.
Pochopte docker-compose.yml a napište jeden, který spustí Varyshop s PostgreSQL, včetně volumes a proměnných prostředí.
There are no comments for now.