Skip to content

Instantly share code, notes, and snippets.

@sujin2f
Last active September 16, 2019 17:46
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 sujin2f/d6ff10312084824d2a2058a70dbdb961 to your computer and use it in GitHub Desktop.
Save sujin2f/d6ff10312084824d2a2058a70dbdb961 to your computer and use it in GitHub Desktop.
Dockerfile #sujinc.com
version: '2'
services:
wordpress:
container_name: wordpress-test
image: yourname/wordpress:latest
external_links:
- mariadb:mysql
- mailhog
environment:
VIRTUAL_HOST: wordpress.test
WORDPRESS_DB_NAME: test
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DEBUG: 1
TZ: America/Toronto
volumes:
- ./:/var/www/html/wp-content
ports:
- 80
restart: always
networks:
- local_default
networks:
local_default:
external: true
version: '2'
services:
db:
container_name: mariadb
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- mysql:/var/lib/mysql
ports:
- 3306:3306
restart: always
networks:
- local_default
proxy:
container_name: nginx-proxy
image: jwilder/nginx-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
command: >
bash -c "touch /etc/nginx/conf.d/max_size.conf
&& echo \"client_max_body_size 100M;\" > /etc/nginx/conf.d/max_size.conf
&& forego start -r"
ports:
- 80:80
restart: always
networks:
- local_default
mailhog:
container_name: mailhog
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
networks:
- local_default
portainer:
container_name: portainer
image: portainer/portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer_data:/data portainer/portainer
ports:
- 9000:9000
volumes:
mysql:
networks:
local_default:
external: true
# This file is making a Wordpress Docker image for developer which includes xDebug, MailHog, ZipArchive, and increased upload size
FROM wordpress:php7.3
# Install x-debug
RUN apt-get update \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& yum install unzip
RUN echo 'zend_extension = xdebug.so' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo 'xdebug.force_display_errors = 1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo 'xdebug.profiler_enable_trigger = 1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo 'xdebug.profiler_output_dir = /opt/storage' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo 'xdebug.var_display_max_children = -1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo 'xdebug.var_display_max_depth = -1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN sed -i "s|html_errors = Off|html_errors = On|g" /usr/local/etc/php/php.ini-production
RUN sed -i "s|html_errors = Off|html_errors = On|g" /usr/local/etc/php/conf.d/error-logging.ini
RUN mkdir /opt/storage
RUN chmod 777 /opt/storage
RUN curl https://github.com/jokkedk/webgrind/archive/v1.6.0.zip -O -J -L
RUN unzip webgrind-1.6.0.zip
# ZipArchive
RUN apt-get install -y \
libzip-dev \
zip \
&& docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip
# Increase Upload Size
RUN echo 'file_uploads = On\nmemory_limit = 100M\nupload_max_filesize = 100M\npost_max_size = 100M\nmax_execution_time = 1000' > /usr/local/etc/php/conf.d/uploads.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment