Skip to content

Instantly share code, notes, and snippets.

@perrmadiafrrian
Created March 24, 2020 13:56
Show Gist options
  • Save perrmadiafrrian/823e762479b5f2c97b1e5a749a1a3685 to your computer and use it in GitHub Desktop.
Save perrmadiafrrian/823e762479b5f2c97b1e5a749a1a3685 to your computer and use it in GitHub Desktop.
Docker
version: "3.7"
services:
web:
image: nginx:alpine
restart: always
volumes:
- .:/var/www/html
- ./default.conf:/etc/nginx/conf.d/default.conf
- ./log:/var/log/nginx
depends_on:
- php
environment:
- VIRTUAL_HOST=monitoring.miyg.com
networks:
- default
- proxy
php:
build:
context: .
dockerfile: Php-Dockerfile
image: localhost:8080/php:fpm-mysql-sqlsrv
# user: 1000:1000
restart: always
volumes:
- .:/var/www/html
networks:
proxy:
external:
name: proxy_network
FROM php:fpm-alpine
#MySQL Driver
RUN docker-php-ext-install mysqli pdo pdo_mysql
#SQL Server Driver
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk && \
curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.2.1-1_amd64.apk && \
apk add --allow-untrusted msodbcsql17_17.5.2.1-1_amd64.apk && \
apk add --allow-untrusted mssql-tools_17.5.2.1-1_amd64.apk && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
pecl install pdo_sqlsrv && \
docker-php-ext-enable pdo_sqlsrv && \
apk del .phpize-deps && \
rm msodbcsql17_17.5.2.1-1_amd64.apk && \
rm mssql-tools_17.5.2.1-1_amd64.apk
#PostgreSQL Driver
# RUN set -ex \
# && apk --no-cache add postgresql-libs postgresql-dev \
# && docker-php-ext-install pgsql pdo_pgsql \
# && apk del postgresql-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment