From db2c80620a7e3a4ce1189442b60281486915863d Mon Sep 17 00:00:00 2001 From: Fascinated Date: Mon, 26 Jun 2023 13:42:14 +0100 Subject: [PATCH] add docker compose example --- examples/docker-compose.md | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 examples/docker-compose.md diff --git a/examples/docker-compose.md b/examples/docker-compose.md new file mode 100644 index 0000000..cccd793 --- /dev/null +++ b/examples/docker-compose.md @@ -0,0 +1,54 @@ +--- +title: How to use Docker Compose +description: +published: true +date: 2023-06-26T13:38:49.025Z +tags: docker, ubuntu, containerization, container, linux, server +editor: markdown +dateCreated: 2023-06-26T13:38:49.025Z +--- + +# How to use Docker Compose + +Examples for using Docker Compose, specifically tested on Ubuntu 22.04. + +## Prerequisites + +- Docker installed on your system +- A user account with sudo privileges + +## Examples + +Base docker-compose.yml file: + +```bash +version: "3" +services: + : + image: + container_name: + restart: + ports: + - ":" + volumes: + - : + environment: + - = +``` + +Nginx docker-compose.yml example: + +```bash +version: "3" +services: + nginx: + image: nginx:latest + container_name: nginx + restart: always + ports: + - "80:80" + volumes: + - /home/nginx:/var/www/html + environment: + - TZ=Europe/London +```