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

Mongo Express returns 404 page not found #16

Open
LorenzoAlu opened this issue Nov 13, 2023 · 4 comments
Open

Mongo Express returns 404 page not found #16

LorenzoAlu opened this issue Nov 13, 2023 · 4 comments

Comments

@LorenzoAlu
Copy link

Hello everyone :)

First of all, congratulations on a great job :)
Unfortunately I have noticed that I have some problems with mongo express in the browser.
Every time I try to access I get the error 404 page not found.
I turn over to you my docker.compose:

#ddev-generated
# Remove the line above if you don't want this file to be overwritten when you run
# ddev get ddev/ddev-mongo
#
# This file comes from https://github.com/ddev/ddev-mongo
#
services:
  mongo:
    container_name: ddev-${DDEV_SITENAME}-mongo
    image: mongo:5-focal
    volumes:
      - type: "volume"
        source: mongo
        target: "/data/db"
        volume:
          nocopy: true
      - ".:/mnt/ddev_config"
    restart: "no"
    expose:
      - "27017"
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    environment:
      - MONGO_INITDB_ROOT_USERNAME=
      - MONGO_INITDB_ROOT_PASSWORD=
      - MONGO_INITDB_DATABASE=db
    healthcheck:
      test: [ "CMD-SHELL", "mongo --eval 'db.runCommand(\"ping\").ok' localhost:27017/test --quiet" ]
      timeout: 60s

  mongo_test: # Nome del servizio per il database di test
    container_name: ddev-${DDEV_SITENAME}-mongo-test
    image: mongo:5-focal
    volumes:
      - type: "volume"
        source: mongo_test # Nome del volume per il database di test
        target: "/data/db"
        volume:
          nocopy: true
    restart: "no"
    expose:
      - "27018" # Porta diversa per il database di test
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    environment:
      - MONGO_INITDB_ROOT_USERNAME= # Nome utente per il database di test
      - MONGO_INITDB_ROOT_PASSWORD= # Password per il database di test
      - MONGO_INITDB_DATABASE=db_test # Nome del database di test

  mongo-express:
    container_name: ddev-${DDEV_SITENAME}-mongo-express
    image: mongo-express:latest
    restart: "no"
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: ${DDEV_APPROOT}
      com.ddev.platform: ddev
    expose:
      - "8081"
    environment:
      VIRTUAL_HOST: $DDEV_HOSTNAME
      ME_CONFIG_BASICAUTH_USERNAME: ''
      ME_CONFIG_BASICAUTH_PASSWORD: ''
      ME_CONFIG_MONGODB_ENABLE_ADMIN: false
      ME_CONFIG_MONGODB_AUTH_USERNAME: ''
      ME_CONFIG_MONGODB_AUTH_PASSWORD: ''
      ME_CONFIG_MONGODB_AUTH_DATABASE: 'db'
      HTTP_EXPOSE: "9091:8081"
    depends_on:
      - mongo
    entrypoint: [ sh, -c, "sleep 5s && tini -- /docker-entrypoint.sh mongo-express" ]

volumes:
  mongo:
  mongo_test:

The only thing I added was a second database for testing and removed local authentication.
For any further information please ask me :)

@rfay
Copy link
Member

rfay commented Nov 13, 2023

It seems like you're saying you changed the docker-compose.mongo.yaml, or you wouldn't have provided it here?

  • Please don't change the docker-compose.mongo.yaml, instead add a docker-compose.mongo_extra.yaml with your changes.
  • Please don't ask for support on something you've changed. Please demonstrate the problem with plain-vanilla add-on first, thanks!

@detrax
Copy link

detrax commented Mar 27, 2024

Hmm, I have the same problem, although I did not change a thing in the configuration. I just set up ddev in my folder and called "ddev get ddev/ddev-mongo". Any ideas?

@stasadev
Copy link
Member

@rfay rfay changed the title Mongo Express return 404 page not found Mongo Express returns 404 page not found Mar 27, 2024
@julienloizelet
Copy link
Collaborator

julienloizelet commented Mar 28, 2024

Hi @detrax,

Check the fix in:

* [Bump mongo-express, update config, do not expand php version, fixes #16 #18](https://github.com/ddev/ddev-mongo/pull/18)

Hi @detrax , I've released a 1.2.0 version with the mentioned fix. Please take a look by running ddev get ddev/ddev-mongo once again. Thanks.

I just set up ddev in my folder and called "ddev get ddev/ddev-mongo"

Don't forget to do a ddev restart (and then a ddev describe will give you the mongo express url).

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

5 participants