Giter Club home page Giter Club logo

Comments (10)

SamuelTallet avatar SamuelTallet commented on July 27, 2024

Hello! :)
MongoDB is the only required extension.
Did you run composer install?
And can you share your Docker files?
Thanks.

from mongodb-php-gui.

itschrono avatar itschrono commented on July 27, 2024

Dockerfile:

FROM php:7.2-fpm


# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN apt-get update
RUN pecl install mongodb
RUN apt-get install zip unzip
RUN docker-php-ext-enable mongodb

RUN rm -Rf /var/www/mongogui_src/
RUN mkdir -p /var/www/mongogui_src/
RUN mkdir -p /var/www/mongogui/
COPY ./src/* /var/www/mongogui_src/
WORKDIR /var/www/mongogui/

RUN mkdir -p /app
COPY run.sh /app/
# RUN composer install
# RUN composer update
# RUN composer dump-autoload --optimize

EXPOSE 9000

run.sh:

rm -Rf /var/www/mongogui/* && mkdir -p /var/www/mongogui/ && cp -R /var/www/mongogui_src/* /var/www/mongogui/ && composer install && composer dump-autoload --optimize && php-fpm

compose file:

  mongogui:
    container_name: mongogui
    build: ./mongodb-php-gui
    command: "sh /app/run.sh"
    ports:
      - 9000:9000
    networks:
      - api-network
      - db-network
    volumes:
      - mongogui_volume:/var/www/mongogui

from mongodb-php-gui.

itschrono avatar itschrono commented on July 27, 2024

And when I target /index.php directly I have a weird redirect to /index.php/index too...

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

Can you try to remove && composer dump-autoload --optimize from run.sh script?

from mongodb-php-gui.

itschrono avatar itschrono commented on July 27, 2024

I added it after to try fixing it so I guess it is not the culprit.

from mongodb-php-gui.

jsl04 avatar jsl04 commented on July 27, 2024

What do I do after running composer install? Is it running? What steps do I need to do to access the GUI?

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

@jsl04

  1. Check if MongoDB PHP extension is enabled
  2. Go to project dir & run php -S 127.0.0.1:5000
  3. Open your browser at: http://127.0.0.1:5000/

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

I commited a Dockerfile and a little doc related to Docker. If problem persists, feel free to re-open an issue.

from mongodb-php-gui.

itschrono avatar itschrono commented on July 27, 2024

Thanks a lot, work like a charm.
Although I modified it a bit to be ssl friendly:

FROM php:7.4-cli-alpine
RUN apk update && apk upgrade

# Clone project repository.
RUN apk add --no-cache git
WORKDIR /opt/mongodb-php-gui
RUN git clone https://github.com/SamuelTS/MongoDB-PHP-GUI.git .

# Enable MongoDB PHP ext.
RUN apk add --no-cache autoconf build-base
RUN apk add --no-cache curl-dev openssl-dev
RUN pecl install mongodb-1.8.2 && docker-php-ext-enable mongodb
RUN pecl config-set php_ini /etc/php.ini

# Install PHP dependencies.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer install

# Start PHP built-in server.
EXPOSE 5000
CMD ["php", "-S", "0.0.0.0:5000"]

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

@itschrono Thanks for the "SSL friendly" patch 😉

from mongodb-php-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.