> For the complete documentation index, see [llms.txt](https://docs.aic-eec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aic-eec.com/general/docker-os/docker-os-part-2/part-2-docker-compose.md).

# Part 2 : Docker compose

## Part 2-1 : Create docker compose

1. ทำการสร้าง docker compose.yml จากไฟล์ตัวอย่าง

```yaml
version: '2'
services:
        db:
                image: mysql:5.7
                container_name: aic_mysql
                volumes:
                        - db_data:/var/lib/mysql
                restart: always
                environment:
                        MYSQL_ROOT_PASSWORD: root_password
                        MYSQL_DATABASE: wordpress
                        MYSQL_USER: wordpress
                        MYSQL_PASSWORD: password
                
        wordpress:
                depends_on:
                        - db
                container_name: aic_wordpress
                image: wordpress:latest
                ports:
                        - "8080:80"
                restart: always
                environment:
                        WORDPRESS_DB_HOST: db:3306
                        WORDPRESS_DB_USER: wordpress
                        WORDPRESS_DB_PASSWORD: password
volumes:
        db_data:
```

2\. ทำการรันด้วยคำสั่ง docker compose

```bash
$ docker compose up -d
```

3\. ทำการตรวจสอบด้วยคำสั่ง docker ps&#x20;

```bash
$ docker ps
```

หน้าต่าง docker desktop ก็จะขึ้นเหมือนกัน

## Part 2-2 : Join with docker compose

อ้างอิงการทดสอบจาก Part 1-2 : ข้อที่ 3-5 แล้วบันทึกผล


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aic-eec.com/general/docker-os/docker-os-part-2/part-2-docker-compose.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
