Skip to content

Instantly share code, notes, and snippets.

@byhbt
Last active December 1, 2018 04:29
Show Gist options
  • Save byhbt/2bd7fe5a659a5d961cac244311da932a to your computer and use it in GitHub Desktop.
Save byhbt/2bd7fe5a659a5d961cac244311da932a to your computer and use it in GitHub Desktop.
docker-compose
version: '3.0'
services:
nginx:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./source:/source
- ./nginx.conf:/etc/nginx/conf.d/default.conf
php:
build: ./php
volumes:
- ./www:/www
db:
image: mysql:5.6.23
volumes:
- db-data:/var/lib/mysql/data
environment:
MYSQL_DATABASE: 'magento'
MYSQL_USER: 'magento'
MYSQL_PASSWORD: 'magento'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8580:80"
links:
- db
volumes:
db-data:
#!/usr/bin/env bash
cd /tmp
cp /opt/dump.sql.gz .
gzip -d dump.sql.gz
mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < dump.sql
FROM php:5.6-fpm
RUN apt-get update && \
apt-get install -y libxml2-dev libmcrypt4 libmcrypt-dev libpng-dev libjpeg-dev libfreetype6 libfreetype6-dev
RUN docker-php-ext-install soap
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mcrypt
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/lib/ --with-freetype-dir=/usr/lib/ && \
docker-php-ext-install gd
RUN apt-get install -y libicu-dev
RUN pecl install intl
RUN docker-php-ext-install intl
COPY ./sampledata/dump.sql.gz /opt/
COPY ./bin/install-sampledata-1.9 /usr/local/bin/install-sampledata
RUN chmod +x /usr/local/bin/install-sampledata
RUN install-sampledata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment