Sign inSign up

hugocpolos/php-sqlserver

By hugocpolos

•Updated almost 5 years ago

Docker image with PHP + APACHE + SQLSERVER DRIVERS

Image
0

460

hugocpolos/php-sqlserver repository overview

⁠Docker image with PHP + APACHE + SQLSERVER DRIVERS

Source code available at https://github.com/hugocpolos/phpsqlserver⁠

All images were built accordingly to the tutorial available at Linux and macOS Installation Tutorial for the Microsoft Drivers for PHP for SQL Server⁠.

⁠How to use it

⁠Pulling the image
docker pull hugocpolos/php-sqlserver
⁠Running the image, at the port 8080, with local source files
docker run -p 8080:80 -v ${PWD}/<source_file_directory>:/var/www/html hugocpolos/php-sqlserver

For instance, with a local file tree as follow:

.
└── src
    ├── foo.php
    └── index.php

The command would be: docker run -p 8080:80 -v ${PWD}/src:/var/www/html hugocpolos/php-sqlserver

⁠In a Dockerfile
FROM hugocpolos/php-sqlserver

RUN echo "<?php phpinfo(); ?>" > /var/www/html/index.php

# or

ADD <dir_with_php_files> /var/www/html

For the file tree above, the Dockerfile would be:

FROM hugocpolos/php-sqlserver
ADD src /var/www/html
⁠With docker-compose

docker-compose.yml example file:

version: '3.0'
services:
  php_sqlserver:
    image: hugocpolos/php-sqlserver

    ports:
      - 8080:80

    volumes:
      - ./src:/var/www/html

Tag summary

Content type

Image

Digest

Size

149.4 MB

Last updated

about 5 years ago

docker pull hugocpolos/php-sqlserver