Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
feat: Added docker-compose and Dockerfile to run pipeline locally
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniCavallari committed Oct 19, 2021
1 parent 5b2df6f commit f59def5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ atlassian*
!.github/
!/bin
!/*.xml
!/docker*

35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM php:7.3-apache

# Download script to install PHP extensions and dependencies
ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync

# Install dependencies
RUN apt-get update -y
RUN apt-get install -y nano unzip
RUN install-php-extensions intl gd soap bcmath pdo_mysql xsl zip

# Install and configure xdebug
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.mode=coverage" >> /usr/local/etc/php/php.ini

# Install composer and downgrade to version 1
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php \
&& HASH=`curl -sS https://composer.github.io/installer.sig` \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& rm -rf composer-setup.php \
&& composer self-update --1

# Install Magento 2
COPY bin/install-mg2.sh bin/install-mg2.sh
RUN sh bin/install-mg2.sh

# Install plugin
COPY src magento2/app/code

# Fix permissions
RUN chmod 777 -Rf magento2
1 change: 1 addition & 0 deletions bin/install-mg2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mv magento2-2.3.6-p1 magento2
cd magento2

echo "Installing..."
composer update
composer install

bin/magento --version
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.7'

services:
mysql:
image: mysql:5.7
container_name: magento-database
environment:
MYSQL_DATABASE: magento_test
MYSQL_HOST: 127.0.0.1
MYSQL_USER: magento
MYSQL_PASSWORD: p@ssw0rd1
MYSQL_ROOT_PASSWORD: p@ssw0rd1
ports:
- 3306:3306

php:
build:
context: .
dockerfile: Dockerfile
args:
username: root
container_name: magento-php
links:
- mysql
ports:
- 8080:80

0 comments on commit f59def5

Please sign in to comment.