Skip to content

Commit 4d19bdf

Browse files
linawolffroemken
andauthored
[DOCS] Document mounting volumes in Docker (#5892)
* [DOCS] Document mounting volumes in Docker Releases: main, 13.4 * Update Documentation/Administration/Docker/Production/Volumes/Index.rst Co-authored-by: Stefan Frömken <[email protected]> * Changes from review --------- Co-authored-by: Stefan Frömken <[email protected]>
1 parent 35cced2 commit 4d19bdf

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

Documentation/Administration/Docker/Production/Index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ strategies.
2323
Distribution/Index
2424
Database/Index
2525
FilePermissions/Index
26+
Volumes/Index
2627
Ports/Index
2728
ReverseProxy/Index
2829

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
:navigation-title: Volumes
2+
3+
.. include:: /Includes.rst.txt
4+
.. _docker-volumes:
5+
6+
============================================
7+
Mounting volumes for TYPO3 Docker containers
8+
============================================
9+
10+
When working with Docker containers, you need to mount volumes. This ensures
11+
that important data persists across container restarts and deployments on the
12+
host machine.
13+
14+
You should typically map these paths to volumes on the host server that you
15+
would not include in an `Incremental deployment
16+
<https://docs.typo3.org/permalink/t3coreapi:manual-deployment-incremental>`_.
17+
18+
This includes user-managed content such as :path:`public/fileadmin`, and cached
19+
content like :path:`var`.
20+
21+
.. _docker-volumes-config:
22+
23+
Configure directories to be mountable in the Docker file
24+
========================================================
25+
26+
Within the :file:`Dockerfile`, you can use the `VOLUME` instruction to create a
27+
mount point for a specified path.
28+
29+
.. seealso::
30+
`VOLUME in the Official Docker Documentation
31+
<https://docs.docker.com/reference/dockerfile/#volume>`_
32+
33+
.. tabs::
34+
35+
.. group-tab:: Classic mode
36+
37+
.. code-block:: bash
38+
39+
VOLUME /var/www/html/fileadmin
40+
VOLUME /var/www/html/typo3conf
41+
VOLUME /var/www/html/typo3temp
42+
43+
.. group-tab:: Composer mode
44+
45+
.. code-block:: bash
46+
47+
VOLUME /var/www/html/public/fileadmin
48+
VOLUME /var/www/html/public/typo3temp
49+
VOLUME /var/www/html/var
50+
51+
.. _docker-volumes-mounting:
52+
53+
Mount the defined volumes on the host system
54+
============================================
55+
56+
The method for mounting Docker volumes depends on how you manage your
57+
containers.
58+
59+
If you use Docker on the console and Docker Compose is available, you can
60+
configure volumes to be mounted in the :file:`docker-compose.yml`. See the
61+
chapter `Create the docker-compose.yml file
62+
<https://docs.typo3.org/permalink/t3coreapi:docker-compose-create-composefile>`_.
63+
64+
If you are using pure Docker commands, refer to `Start the TYPO3 container with
65+
mounted writable directories
66+
<https://docs.typo3.org/permalink/t3coreapi:classic-docker-typo3>`_.
67+
68+
Some hosting providers offer a graphical interface to define volumes.
69+
70+
.. note::
71+
If a volume is **not mounted** on the host server, its content will be lost
72+
when you stop and restart the container or update it.
73+
74+
Ensure you have a `secure backup strategy
75+
<https://docs.typo3.org/permalink/t3coreapi:administration-backups>`_ for
76+
user-created content in mounted volumes.

0 commit comments

Comments
 (0)