@@ -18,7 +18,7 @@ In this tutorial we will use:
18
18
19
19
- Python 3
20
20
- Docker
21
- - Docker-compose
21
+ - Docker Compose
22
22
23
23
Start from the scratch or jump to the section:
24
24
@@ -47,28 +47,27 @@ response it will log:
47
47
Prerequisites
48
48
-------------
49
49
50
- We will use `Docker <https://www.docker.com/ >`_ and
51
- `docker-compose <https://docs.docker.com/compose/ >`_ in this tutorial. Let's check the versions:
50
+ We will use `docker compose <https://docs.docker.com/compose/ >`_ in this tutorial. Let's check the versions:
52
51
53
52
.. code-block :: bash
54
53
55
54
docker --version
56
- docker- compose -- version
55
+ docker compose version
57
56
58
57
The output should look something like:
59
58
60
59
.. code-block :: bash
61
60
62
- Docker version 20.10.5 , build 55c4c88
63
- docker-compose version 1 .29.0, build 07737305
61
+ Docker version 27.3.1 , build ce12230
62
+ Docker Compose version v2 .29.7
64
63
65
64
.. note ::
66
65
67
- If you don't have ``Docker `` or ``docker- compose `` you need to install them before proceeding.
66
+ If you don't have ``Docker `` or ``docker compose `` you need to install them before proceeding.
68
67
Follow these installation guides:
69
68
70
69
- `Install Docker <https://docs.docker.com/get-docker/ >`_
71
- - `Install docker- compose <https://docs.docker.com/compose/install/ >`_
70
+ - `Install docker compose <https://docs.docker.com/compose/install/ >`_
72
71
73
72
The prerequisites are satisfied. Let's get started with the project layout.
74
73
@@ -129,13 +128,13 @@ Put next lines into the ``requirements.txt`` file:
129
128
pytest-cov
130
129
131
130
Second, we need to create the ``Dockerfile ``. It will describe the daemon's build process and
132
- specify how to run it. We will use ``python:3.9-buster `` as a base image.
131
+ specify how to run it. We will use ``python:3.13-bookworm `` as a base image.
133
132
134
133
Put next lines into the ``Dockerfile `` file:
135
134
136
135
.. code-block :: bash
137
136
138
- FROM python:3.10-buster
137
+ FROM python:3.13-bookworm
139
138
140
139
ENV PYTHONUNBUFFERED=1
141
140
@@ -155,8 +154,6 @@ Put next lines into the ``docker-compose.yml`` file:
155
154
156
155
.. code-block :: yaml
157
156
158
- version : " 3.7"
159
-
160
157
services :
161
158
162
159
monitor :
@@ -171,7 +168,7 @@ Run in the terminal:
171
168
172
169
.. code-block :: bash
173
170
174
- docker- compose build
171
+ docker compose build
175
172
176
173
The build process may take a couple of minutes. You should see something like this in the end:
177
174
@@ -184,7 +181,7 @@ After the build is done run the container:
184
181
185
182
.. code-block :: bash
186
183
187
- docker- compose up
184
+ docker compose up
188
185
189
186
The output should look like:
190
187
@@ -461,7 +458,7 @@ Run in the terminal:
461
458
462
459
.. code-block :: bash
463
460
464
- docker- compose up
461
+ docker compose up
465
462
466
463
The output should look like:
467
464
@@ -705,7 +702,7 @@ Run in the terminal:
705
702
706
703
.. code-block :: bash
707
704
708
- docker- compose up
705
+ docker compose up
709
706
710
707
You should see:
711
708
@@ -813,7 +810,7 @@ Run in the terminal:
813
810
814
811
.. code-block :: bash
815
812
816
- docker- compose up
813
+ docker compose up
817
814
818
815
You should see:
819
816
@@ -965,15 +962,16 @@ Run in the terminal:
965
962
966
963
.. code-block :: bash
967
964
968
- docker- compose run --rm monitor py.test monitoringdaemon/tests.py --cov=monitoringdaemon
965
+ docker compose run --rm monitor py.test monitoringdaemon/tests.py --cov=monitoringdaemon
969
966
970
967
You should see:
971
968
972
969
.. code-block :: bash
973
970
974
- platform linux -- Python 3.10.0 , pytest-6.2.5, py-1.10.0, pluggy-1.0 .0
971
+ platform linux -- Python 3.13.1 , pytest-8.3.4, pluggy-1.5 .0
975
972
rootdir: /code
976
- plugins: asyncio-0.16.0, cov-3.0.0
973
+ plugins: cov-6.0.0, asyncio-0.24.0
974
+ asyncio: mode=Mode.STRICT, default_loop_scope=None
977
975
collected 2 items
978
976
979
977
monitoringdaemon/tests.py .. [100%]
0 commit comments