--- title: Docker description: "Containers for running applications in a consistent environment. Image, container, volume, and network are the core terms." canonical: https://penasihathosting.com/en/hosting-wiki/docker type: wiki locale: en updated: 2026-10-29 author: Willya Randika --- # Docker ## Overview - **Summary:** Containers for running applications in a consistent environment. Image, container, volume, and network are the core terms. - **Author:** Willya Randika ([profile](/penulis/willya-randika)) ## Article **Docker** is a container platform that packages an application and its dependencies into an **image**, then runs it as an isolated **container**. In hosting, Docker is used for applications, databases, queues, or internal tools that need a consistent environment. ## Core terms | Term | Meaning | | --- | --- | | **Image** | Read-only template with the application and dependencies | | **Container** | A running instance of an image | | **Volume** | Persistent storage outside the container lifecycle | | **Network** | Virtual network between containers | | **Dockerfile** | Recipe for building an image | | **Compose** | Definition of several containers in one file | ## Basic flow ```bash docker build -t my-app . docker run -d --name app -p 3000:3000 my-app ``` For data that must survive, mount a volume: ```bash docker run -d -v app-data:/var/lib/app my-app ``` ## What to watch for - **A container is not a VM.** Isolation is lighter; do not treat it as a full security boundary. - **Data belongs in a volume.** Files inside the container disappear when it is removed. - **Resource limits matter.** Without CPU/RAM limits, one container can exhaust the VPS. - **Update images regularly.** Old images carry unpatched vulnerabilities. - **RAM and disk are finite.** A small VPS with many containers runs out quickly. - **Ports and reverse proxy.** Containers usually listen on an internal port, then Nginx/Caddy forwards HTTPS traffic. Every container uses RAM and disk. On a 1–2 GB VPS, run only the services you need, set memory limits, and monitor image size. Use `docker system prune` regularly, but never remove volumes still in use. For production, store images in a registry and deploy explicit versions, not `latest`. Separate the database from the app container when possible. ## FAQ No. Docker packages and runs applications; the VPS is the machine the containers run on. Data in the container filesystem can disappear when the container is removed. Use a volume for data that must persist. It can be, provided images are updated, containers do not run as root, resources are limited, and network access is controlled.