Closed itschrono closed 3 years ago
Hello! :)
MongoDB is the only required extension.
Did you run composer install
?
And can you share your Docker files?
Thanks.
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
And when I target /index.php directly I have a weird redirect to /index.php/index too...
Can you try to remove && composer dump-autoload --optimize
from run.sh script?
I added it after to try fixing it so I guess it is not the culprit.
What do I do after running composer install? Is it running? What steps do I need to do to access the GUI?
@jsl04
php -S 127.0.0.1:5000
I commited a Dockerfile and a little doc related to Docker. If problem persists, feel free to re-open an issue.
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"]
@itschrono Thanks for the "SSL friendly" patch 😉
Hello, I cannot get it to work with docker php-fpm 7.2. => PHP Fatal error: Uncaught Error: Class 'Controllers\LoginController' not found in routes.php
Should I install / enable another extension along mongodb ??? Thanks