[Ubuntu 22.04] [Apache] [PHP-FPM 7.4] [SQLServer modules]
576
################
## Dockerfile ##
################
################
## Description ##
################
# - Apache2
# - sqlsrv
# - pdo_sql
# - PHP7.4
# 20.04, focal-20210713, focal, latest
FROM ubuntu:20.04
USER root
WORKDIR /root
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y tzdata
RUN apt-get install -y build-essential
RUN apt-get install -y apt-utils
RUN apt-get install -y nano
RUN apt-get install -y vim
RUN apt-get install -y software-properties-common
RUN apt-get install -y curl
RUN apt-get install -y apache2
RUN apt-get install -y sudo
RUN apt-get install -y php7.4
RUN apt-get install -y php7.4-cli
RUN apt-get install -y php7.4-common
RUN apt-get install -y php7.4-curl
RUN apt-get install -y php7.4-gd
RUN apt-get install -y php7.4-mbstring
RUN apt-get install -y php7.4-opcache
RUN apt-get install -y php7.4-mysql
RUN apt-get install -y php7.4-soap
RUN apt-get install -y php7.4-xmlrpc
RUN apt-get install -y php7.4-xml
RUN apt-get install -y php7.4-xsl
RUN apt-get install -y php7.4-zip
RUN apt-get install -y php7.4-dev
RUN apt-get install -y php7.4-intl
RUN apt-get install -y libapache2-mod-php7.4
RUN a2dismod mpm_event
RUN a2enmod mpm_prefork
RUN a2enmod php7.4
RUN apt-get install -y php7.4-fpm
RUN a2enmod proxy_fcgi setenvif
RUN a2enconf php7.4-fpm
RUN service apache2 restart
#ENV APACHE_RUN_USER www-data
#ENV APACHE_RUN_GROUP www-data
#ENV APACHE_LOG_DIR /var/log/apache2
#ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
#ENV APACHE_RUN_DIR /var/run/apache2
#ENV APACHE_LOCK_DIR /var/lock/apache2
#ENV APACHE_LOG_DIR /var/log/apache2
#############################################################
## Install Microsoft ODBC Driver for SQL Server (Linux) ##
#############################################################
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
# Ubuntu 20.04
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
ENV ACCEPT_EULA=Y
RUN apt-get install -y msodbcsql17
# optional: for bcp and sqlcmd
RUN apt-get install -y mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
#RUN source ~/.bashrc
# optional: for unixODBC development headers
RUN apt-get install -y unixodbc-dev
###################################################
## Drivers Microsoft from PHP and SQL Server ##
###################################################
RUN pecl config-set php_ini /etc/php/7.4/fpm/php.ini
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
RUN printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.4/mods-available/sqlsrv.ini
RUN printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.4/mods-available/pdo_sqlsrv.ini
RUN phpenmod -v 7.4 sqlsrv pdo_sqlsrv
RUN service apache2 restart
RUN service php7.4-fpm restart
RUN apt-get install -y inetutils-ping
RUN a2enmod rewrite ssl
##########################
## Configurações finais ##
##########################
RUN sed -i s/'AllowOverride None'/'AllowOverride All'/g /etc/apache2/apache2.conf
RUN echo "ServerName 'OLOKO'" >> /etc/apache2/apache2.conf
RUN sed -i s/'display_errors = Off'/'display_errors = On'/g /etc/php/7.4/apache2/php.ini
RUN echo t-rex2 > /etc/hostname
#EXPOSE 8888
RUN apt-get install -y redis
# RUN apt-get install -y redis-server
RUN apt-get install -y php7.4-redis
RUN apt-get install -y iproute2
#RUN apt-get install -y mariadb-client
RUN apt-get install -y wget
RUN apt-get install -y php7.4-imap
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -yq install phpmyadmin
RUN rm -rf /var/www/html/phpmyadmin
RUN ln -s /usr/share/phpmyadmin /var/www/html/
RUN apt-get install -y composer
RUN apt-get install -y php7.4-ldap
RUN apt-get install -y phploc
RUN apt-get install -y npm
RUN yes | npm i -g gulp
RUN yes | npm i -g terser
ENTRYPOINT ["/usr/sbin/apache2ctl"]
CMD ["-D", "FOREGROUND"]
Content type
Image
Digest
Size
372.3 MB
Last updated
about 4 years ago
docker pull edilycesar/ubuntu_web1:1.1