Skip to content

docker-compose volumes #124

Closed
Closed

Description

@mostafahussein

Why do we have to mount app, public, src and vendor while we have added them to the docker image itself?
Also, I would recommend to use named volumes instead of the current way.
Let me know about your thoughts so I can work on it if anything needs to be done.

volumes:
- ./app:/usr/share/nginx/html/app
- ./public:/usr/share/nginx/html/public
- ./src:/usr/share/nginx/html/src
- ./vendor:/usr/share/nginx/html/vendor
- ./docker/nginx.conf:/etc/nginx/nginx.conf:rw
- ./storage/uploads:/storage/uploads:rw
- ./storage/cache:/storage/cache:rw

Activity

  1. eldadfux commented on Oct 4, 2019

    @eldadfux
    Member

    These are the volumes we need for development only mode. Up until our latest version, we only mapped the ./storage directory, but that caused some permission issues for some developers (storage also contains DB directories).

    The production public docker-compose is here: https://appwrite.io/docker-compose.yml

    This is the docker-compose.yml we give non-maintainers to setup.

    Named volumes sound like a good idea, but I am not familiar with them. What are their advantages compared to plain volumes?

  2. mostafahussein commented on Oct 4, 2019

    @mostafahussein
    ContributorAuthor

    Named volumes are completely managed by Docker, not by your side. But as you use it for developers I would suggest having the following structure:
    1- docker-compose.yml
    2- docker-compose.development.yml
    2- docker-compose.public.yml
    And we you run it you would need to use the following command:

    # In case of development usage
    docker-compose up -d -f docker-compose.yml -f docker-compose.development.yml
    

    Next, we can have both the path based volumes inside the development file and the needed named volumes inside the public file because the public/development file will override the already existing keys. so for example, if you have an environment called X=hello inside docker-compose.yml you can override it by defining it inside one of these additional files.

  3. self-assigned this
    on Oct 5, 2019
  4. added
    enhancement
    on Oct 5, 2019
  5. eldadfux commented on Nov 23, 2019

    @eldadfux
    Member

    Hey @mostafahussein, so I took your advice and moved all our docker-compose files to use volumes instead of mounts. This seems to really help solve some of the problems we faced related to read and write permissions errors in the DB or storage services.

    Thanks!!

  6. mostafahussein commented on Nov 23, 2019

    @mostafahussein
    ContributorAuthor

    Glad to hear that!

  7. added a commit that references this issue on Sep 16, 2026
  8. added a commit that references this issue on Sep 28, 2026
  9. added a commit that references this issue on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions