Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3.1'
- services:
- db:
- image: mysql
- restart: always
- environment:
- - MYSQL_DATABASE=mgsv
- - MYSQL_USER=mgsv_user
- - MYSQL_PASSWORD=mgsvpass
- - MYSQL_ROOT_PASSWORD=mysql123
- volumes:
- - ./mysql:/docker-entrypoint-initdb.d
- www:
- build: ./mGSV
- restart: always
- ports:
- - 8080:80
- <?php
- echo "Hello World!";
- //mysqli_connect("localhost","my_user","my_password","my_db");
- $con = mysqli_connect("localhost","mgsv_user","mgsvpass","mgsv");
- // Check connection
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- else {
- echo "done";
- }
- ?>
- FROM php:5-apache
- RUN apt-get update && apt-get install -y --no-install-recommends
- openjdk-7-jdk
- maven
- git
- && rm -rf /var/lib/apt/lists/*
- RUN docker-php-source extract
- && docker-php-ext-install mysql mysqli pdo pdo_mysql
- && docker-php-source delete
- RUN cd /var/www/html/ && git clone https://github.com/qunfengdong/mGSV.git
- # Move the folder 'mgsv' to DocumentRoot of Apache web server. By default, the DocumentRoot of Apache is /var/www/ (speak to the system administrator to know the exact DocumentRoot).
- RUN cd /var/www/html/mGSV
- && mkdir tmp
- && chmod -R 777 tmp
- RUN cd /var/www/html/mGSV && sed -i.bak "s|'gsv'|'mgsv_user'|" lib/settings.php
- && sed -i.bak "s|$database_pass = ''|$database_pass = 'mgsvpass'|" lib/settings.php
- && sed -i.bak "s|cas-qshare.cas.unt.edu|localhost|" lib/settings.php
- RUN cp /var/www/html/mGSV/Arial.ttf /usr/share/fonts/truetype/
- RUN cd /var/www/html/mGSV/ws
- && tar -xzf mgsv-ws-server.tar.gz
- RUN cd /var/www/html/mGSV/ws/mgsv-ws-server
- && mvn package
- RUN cp -f /var/www/html/mGSV/ws/mgsv-ws-server/target/ws-server-1.0RC1-jar-with-dependencies.jar /var/www/html/mGSV/ws/
- RUN cd /var/www/html/mGSV/ws
- && echo "mgsv_upload_url=http://localhost/mgsv" > config.properties
- && echo "ws_publish_url=http://localhost:8081/MGSVService" >> config.properties
- && java -jar ws-server-1.0RC1-jar-with-dependencies.jar &
- COPY ./index.php /var/www/html/
- RUN a2enmod rewrite
- Hello World!
- Warning: mysqli_connect(): (HY000/2002): No such file or directory in /var/www/html/index.php on line 4
- Failed to connect to MySQL: No such file or directory
Add Comment
Please, Sign In to add comment