This shows you the differences between two versions of the page.
ii:labs:s2:05 [2024/04/29 19:23] radu.ciobanu [Introduction] |
ii:labs:s2:05 [2025/04/13 18:19] (current) florin.stancu |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | ====== Lab 05 - Docker Compose ====== | + | ====== Lab 06 - Docker Compose ====== |
===== Objectives ===== | ===== Objectives ===== | ||
Line 43: | Line 43: | ||
<code yaml> | <code yaml> | ||
# docker-compose.yml | # docker-compose.yml | ||
- | version: "3.8" | + | #version: "3.8" |
services: | services: | ||
Line 54: | Line 54: | ||
- "5000:80" | - "5000:80" | ||
networks: | networks: | ||
- | - lab4-network | + | - lab5-network |
postgres: | postgres: | ||
image: postgres:12 | image: postgres:12 | ||
volumes: | volumes: | ||
- | - lab4-volume:/var/lib/postgresql/data | + | - lab5-volume:/var/lib/postgresql/data |
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql | - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql | ||
networks: | networks: | ||
- | - lab4-network | + | - lab5-network |
volumes: | volumes: | ||
- | lab4-volume: | + | lab5-volume: |
networks: | networks: | ||
- | lab4-network: | + | lab5-network: |
</code> | </code> | ||
Line 75: | Line 75: | ||
The //**version**// attribute describes what [[https://docs.docker.com/compose/compose-file/|functionalities]] will be loaded when running the Docker Compose utility. | The //**version**// attribute describes what [[https://docs.docker.com/compose/compose-file/|functionalities]] will be loaded when running the Docker Compose utility. | ||
- | <note warning>You must specify the version in any Docker Compose file.</note> | + | <note warning>The ''version'' field has been deprecated on modern docker compose versions.</note> |
=== Services === | === Services === |