Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker] Avoid having to use network "host" mode? #10

Closed
Ezwen opened this issue Jul 28, 2018 · 3 comments
Closed

[Docker] Avoid having to use network "host" mode? #10

Ezwen opened this issue Jul 28, 2018 · 3 comments

Comments

@Ezwen
Copy link

Ezwen commented Jul 28, 2018

Hi!

The provided Docker compose file is the following one:

version: '3'
services:

    # Cells image with two named volumes for the static and for the data
    cells:
        image: pydio/cells:latest
        restart: always
        volumes: ["static:/root/.config/pydio/cells/static/pydio", "data:/root/.config/pydio/cells/data"]
        ports: ["8080:8080"]
        environment:
            - CELLS_BIND=localhost:8080
            - CELLS_EXTERNAL=localhost:8080
            - CELLS_NO_SSL=1

    # MySQL image with a default database cells and a dedicated user pydio
    mysql:
         image: mysql:5.7
         restart: always
         environment:
             MYSQL_ROOT_PASSWORD: P@ssw0rd
             MYSQL_DATABASE: cells
             MYSQL_USER: pydio
             MYSQL_PASSWORD: P@ssw0rd
         command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
         ports: ["3306:3306"]

    # PHP FPM image with the static named volume from the cells container
    php:
        image: pydio/cells-php-fpm:latest
        restart: always
        volumes: ["static:/root/.config/pydio/cells/static/pydio"]

volumes:
    static: {}
    data: {}

With the following note:

We use network mode host to facilitate the setup.

At first I had not seen the note, and I was not understanding why I could not make it work, since I never use the host networking mode. Then I realized that the php container was trying to talk to localhost:8080 instead of cells:8080, and authentication was failing.

Since the Docker host networking mode is not the default one, and since a certain range of people would prefer to avoid this mode, would you consider in the future a way to configure the containers to avoid using such mode altogether? For instance, by making sure the php container is aware it should talk to cells instead of localhost (if I understood this right)?

Thanks for your work on Pydio!

@vabatta
Copy link

vabatta commented Aug 13, 2018

Was you able to run and login somehow?

@ghecquet
Copy link
Member

Hi there,

Thanks very much for your support.

The docker-compose file is just there as an example and should not by any means considered as a sacred test :) It will all depend on your docker version, os etc... and is just there to provide guidelines.

For instance in this context, the php container is using the CELLS_BIND variable that you've defined above to know where it should connect. We're aware the current setup with the php fpm is not ideal. That's why we'll soon be rid of php. Stay tuned.

In the meantime, if you still have problems in your setup, you should consider positing it to the forum.

@Ezwen
Copy link
Author

Ezwen commented Sep 12, 2018

Thanks for you answer! I'll stay tuned then :)

bsinou added a commit that referenced this issue Sep 27, 2018
Merge from remote master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants