Skip to content

Instantly share code, notes, and snippets.

@rodrigobertin
Last active October 16, 2018 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigobertin/f71787db16fde101221889a570a75032 to your computer and use it in GitHub Desktop.
Save rodrigobertin/f71787db16fde101221889a570a75032 to your computer and use it in GitHub Desktop.
Dockers RNB
docker build local.dev -t .
# Mysql
docker run -p 3306:3306 --name mysql.dev -e MYSQL_ROOT_PASSWORD=vagrant -d -v /Users/rnb/Documents/Databases:/var/lib/mysql mysql/mysql-server:5.7
#Apache PHP
docker run -d -p 8888:80 -v ~/Sync/SITES/:/var/www/html -v /Users/rnb/Documents/Vhost:/etc/apache2/sites-enabled --name local.dev --link mysql.dev:mysqldb local.dev
# Sync Cloud
version: '2'
services:
db:
image: mariadb:10.1
environment:
MYSQL_ROOT_PASSWORD: federicoB88
MYSQL_USER: rnb
MYSQL_PASSWORD: federicoB88
MYSQL_DATABASE: filerun
restart: on-failure
volumes:
- ./Docker/DATABASES:/var/lib/mysql
files:
image: afian/filerun
environment:
FR_DB_HOST: db
FR_DB_PORT: 3306
FR_DB_NAME: filerun
FR_DB_USER: root
FR_DB_PASS: federicoB88
depends_on:
- db
links:
- db:db
ports:
- "80:80"
volumes:
- ./Docker/filerun/html:/var/www/html
- ./DATA:/user-files
resilo:
image: resilio/sync
ports:
- "8888:8888"
- "55555"
volumes:
- ./SYNC:/mnt/sync
- ./DATA:/mnt/mounted_folders/DATA
restart: on-failure
FROM ubuntu:16.04
MAINTAINER Rodrigo Bertin <rodrigonbertin@gmail.com>
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install software-properties-common
RUN export LANG=C.UTF-8
ENV LANG=C.UTF-8
ENV FOLDER_SITE=/var/www/html
RUN add-apt-repository ppa:ondrej/apache2
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update
#Install apache, PHP, and supplimentary programs. openssh-server, curl, and lynx-cur are for debugging the container.
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install \
apache2 php7.1 php7.1-mysql libapache2-mod-php7.1 curl lynx-cur apache2-utils libexpat1 ssl-cert python libapache2-mod-wsgi \
php7.1 libapache2-mod-php7.1 php7.1-mcrypt php7.1-cli php7.1-xml php7.1-zip php7.1-mysql php7.1-gd php7.1-imagick php7.1-recode php7.1-tidy php7.1-xmlrpc
RUN apt-get -y install sqlite
RUN apt-get -y install libsqlite3-0 libsqlite3-dev php7.1-sqlite3
RUN apt-get install -y php7.1-imap php7.1-json php7.1-gd
RUN apt-get install -y php7.1-common
RUN apt-get install -y php7.1-curl
RUN apt-get install -y php7.1-dev
RUN apt-get install -y php7.1-gd
RUN apt-get install -y php7.1-gmp
RUN apt-get install -y php7.1-json # JSON module for PHP
RUN apt-get install -y php7.1-ldap #LDAP module for PHP
RUN apt-get install -y php7.1-mysql # MySQL module for PHP
RUN apt-get install -y php7.1-odbc # ODBC module for PHP
RUN apt-get install -y php7.1-opcache # Zend OpCache module for PHP
RUN apt-get install -y php7.1-pgsql # PostgreSQL module for PHP
RUN apt-get install -y php7.1-pspell # pspell module for PHP
RUN apt-get install -y php7.1-readline # readline module for PHP
RUN apt-get install -y php7.1-recode # recode module for PHP
RUN apt-get install -y php7.1-snmp # SNMP module for PHP
RUN apt-get install -y php7.1-sqlite3 # SQLite3 module for PHP
RUN apt-get install -y php7.1-tidy # tidy module for PHP
RUN apt-get install -y php7.1-xml # DOM, SimpleXML, WDDX, XML, and XSL module for PHP
RUN apt-get install -y php7.1-xmlrpc # XMLRPC-EPI module for PHP
RUN apt-get install -y libphp7.1-embed # HTML-embedded scripting language (Embedded SAPI library)
RUN apt-get install -y php7.1-bcmath # Bcmath module for PHP
RUN apt-get install -y php7.1-bz2 # bzip2 module for PHP
RUN apt-get install -y php7.1-enchant # Enchant module for PHP
RUN apt-get install -y php7.1-fpm
RUN apt-get install -y php7.1-imap
RUN apt-get install -y php7.1-interbase
RUN apt-get install -y php7.1-intl
RUN apt-get install -y php7.1-mbstring
RUN apt-get install -y php7.1-mcrypt
RUN apt-get install -y php7.1-phpdbg
RUN apt-get install -y php7.1-soap
RUN apt-get install -y php7.1-sybase
RUN apt-get install -y php7.1-xsl
RUN apt-get install -y php7.1-zip
RUN apt-get install -y php7.1-dba
RUN apt-get -y install php7.1 libapache2-mod-php7.1 libapache2-mod-php
RUN apt-get -y install vim
RUN apt-get -y install mc
#Update the PHP.ini file, enable <? ?> tags and quieten logging.
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.1/apache2/php.ini
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.1/apache2/php.ini
#update virtualhost file rewrite mode enabled
RUN sed -i "s/<VirtualHost \*:80>/<VirtualHost *:80>\n <Directory $FOLDER_SITE>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride All\n Require all granted\n <\/Directory>/" /etc/apache2/sites-available/000-default.conf
#Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
#Enable apache mods
RUN a2enmod php7.1
RUN a2enmod rewrite
RUN a2enmod wsgi
#Expose apache.
EXPOSE 80
#Volumen
VOLUME /var/www/html
VOLUME /etc/apache2/sites-enabled
#By default start up apache in the foreground, override with /bin/bash for interative.
CMD /usr/sbin/apache2ctl -D FOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment