Skip to content

Commit 4bac42f

Browse files
committed
Updated magento2-dev-docker
1 parent 367cc3a commit 4bac42f

50 files changed

Lines changed: 20697 additions & 173 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ NGINX_PORT=8080
2222
###> php configuration ###
2323

2424
# php version
25-
# ie: 7.4
26-
PHP_VERSION=7.4
25+
# ie: 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1
26+
PHP_VERSION=8.1
2727

2828
# php fpm expose port
2929
PHP_FPM_PORT=9000

.github/workflows/docker-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Docker Build
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
- name: Docker build cache
16+
uses: satackey/action-docker-layer-caching@v0.0.8
17+
continue-on-error: true
18+
- name: Copy .env.sample to .env
19+
run: cp .env.sample .env
20+
- name: For php8.1
21+
run: PHP_VERSION=8.1 docker-compose -f docker-compose-publish.yml build
22+
- name: For php8.0
23+
run: PHP_VERSION=8.0 docker-compose -f docker-compose-publish.yml build
24+
- name: For php7.4
25+
run: PHP_VERSION=7.4 docker-compose -f docker-compose-publish.yml build
26+
- name: For php7.3
27+
run: PHP_VERSION=7.3 docker-compose -f docker-compose-publish.yml build
28+
- name: For php7.2
29+
run: PHP_VERSION=7.2 docker-compose -f docker-compose-publish.yml build
30+
- name: For php7.1
31+
run: PHP_VERSION=7.1 docker-compose -f docker-compose-publish.yml build
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Publish
2+
3+
on:
4+
schedule:
5+
- cron: '30 10 * * *'
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
- name: Docker build cache
18+
uses: satackey/action-docker-layer-caching@v0.0.8
19+
continue-on-error: true
20+
- name: Docker Login
21+
env:
22+
DOCKER_USER: ${{secrets.DOCKER_USER}}
23+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
24+
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
25+
- name: Copy .env.sample to .env
26+
run: cp .env.sample .env
27+
- name: For php8.1
28+
run: PHP_VERSION=8.1 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=8.1 docker-compose -f docker-compose-publish.yml push
29+
- name: For php8.0
30+
run: PHP_VERSION=8.0 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=8.0 docker-compose -f docker-compose-publish.yml push
31+
- name: For php7.4
32+
run: PHP_VERSION=7.4 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.4 docker-compose -f docker-compose-publish.yml push
33+
- name: For php7.3
34+
run: PHP_VERSION=7.3 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.3 docker-compose -f docker-compose-publish.yml push
35+
- name: For php7.2
36+
run: PHP_VERSION=7.2 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.2 docker-compose -f docker-compose-publish.yml push
37+
- name: For php7.1
38+
run: PHP_VERSION=7.1 docker-compose -f docker-compose-publish.yml build && PHP_VERSION=7.1 docker-compose -f docker-compose-publish.yml push

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ A development docker for every magento2 project
77

88
- Build for magento2 projects
99
- Bundle of `fpm`, `cli`, `nginx`, `mariadb`, `phpmyadmin`, `redis` , `elasticsearch`, `rabbitmq`, `emailcatcher` and `varnish` containers
10-
- Latest PHP versions
11-
- php7.4 (for Magento2.4.x - default)
10+
- PHP 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 supported
1211
- Latest database mariadb10.4, mariadb10.2 and other versions supported
1312
- Latest node14.x, node13.x, node12.x, ... supported
1413
- Latest redis-6.x, redis-5.x, ... supported

docker-compose-publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: '3'
2+
3+
services:
4+
fpm:
5+
build:
6+
context: php${PHP_VERSION}/fpm
7+
args:
8+
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
9+
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
10+
image: readymadehost/magento2-dev-docker-php${PHP_VERSION}-fpm:latest
11+
12+
cli:
13+
build:
14+
context: php${PHP_VERSION}/cli
15+
args:
16+
NODE_VERSION: ${NODE_VERSION}
17+
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
18+
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
19+
image: readymadehost/magento2-dev-docker-php${PHP_VERSION}-cli:latest

docker-compose.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ services:
2626
args:
2727
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
2828
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
29+
image: readymadehost/magento2-dev-docker-php${PHP_VERSION}-fpm:latest
30+
environment:
31+
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
32+
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
2933
ports:
3034
- ${PHP_FPM_PORT}:9000
3135
volumes:
@@ -44,6 +48,10 @@ services:
4448
NODE_VERSION: ${NODE_VERSION}
4549
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
4650
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
51+
image: readymadehost/magento2-dev-docker-php${PHP_VERSION}-cli:latest
52+
environment:
53+
PHP_ENABLE_REDIS: ${PHP_ENABLE_REDIS}
54+
PHP_ENABLE_XDEBUG: ${PHP_ENABLE_XDEBUG}
4755
working_dir: /var/www/project
4856
volumes:
4957
- ./project:/var/www/project
@@ -104,7 +112,7 @@ services:
104112
volumes:
105113
- './data/rabbitmq:/var/lib/rabbitmq'
106114

107-
mailcatcher:
108-
image: sj26/mailcatcher
109-
ports:
110-
- ${MAILCATCHER_PORT}:1080
115+
# mailcatcher:
116+
# image: sj26/mailcatcher
117+
# ports:
118+
# - ${MAILCATCHER_PORT}:1080

php7.1/cli/Dockerfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM php:7.1-cli
2+
3+
LABEL maintainer="ReadyMadeHost http://readymadehost.com"
4+
5+
# Installing required packages
6+
RUN apt-get update
7+
RUN apt-get install --no-install-recommends -y procps \
8+
curl \
9+
git \
10+
vim \
11+
zip \
12+
unzip \
13+
wget
14+
RUN apt-get install --no-install-recommends -y mariadb-client
15+
16+
ARG NODE_VERSION
17+
ENV NODE_VERSION ${NODE_VERSION}
18+
19+
# Installing node
20+
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
21+
RUN apt-get -y install nodejs
22+
23+
# Installing yarn and grunt-cli using npm
24+
RUN npm install --global yarn
25+
RUN npm install --global grunt-cli
26+
27+
# Installing extensions
28+
RUN curl -L https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \
29+
-o /usr/local/bin/install-php-extensions && chmod +x /usr/local/bin/install-php-extensions
30+
31+
# Installing extensions
32+
RUN install-php-extensions \
33+
pdo_mysql \
34+
intl \
35+
mbstring \
36+
zip \
37+
exif \
38+
pcntl \
39+
bcmath \
40+
ctype \
41+
curl \
42+
dom \
43+
iconv \
44+
simplexml \
45+
soap \
46+
xsl \
47+
sockets \
48+
opcache \
49+
gd \
50+
imagick \
51+
apcu \
52+
@composer
53+
54+
# Installing other extensions but enabled dynamically
55+
RUN IPE_DONT_ENABLE=1 install-php-extensions redis \
56+
mongodb \
57+
xdebug
58+
59+
# Updating php.ini
60+
ADD conf/php.ini /usr/local/etc/php/php.ini
61+
62+
# Manage project and add scripts
63+
RUN mkdir -p /var/www/project
64+
ADD manage-project-permission.sh /root/manage-project-permission.sh
65+
RUN chmod +x /root/manage-project-permission.sh
66+
RUN echo 'alias mpp="/root/manage-project-permission.sh"' >> /root/.bashrc
67+
RUN /root/manage-project-permission.sh
68+
69+
ARG PHP_ENABLE_REDIS
70+
ENV PHP_ENABLE_REDIS ${PHP_ENABLE_REDIS}
71+
ARG PHP_ENABLE_XDEBUG
72+
ENV PHP_ENABLE_XDEBUG ${PHP_ENABLE_XDEBUG}
73+
ARG PHP_ENABLE_MONGODB
74+
ENV PHP_ENABLE_MONGODB ${PHP_ENABLE_MONGODB}
75+
76+
ADD docker-entrypoint.sh /root/docker-entrypoint.sh
77+
RUN chmod +x /root/docker-entrypoint.sh
78+
79+
CMD ["/root/docker-entrypoint.sh", "bash"]

0 commit comments

Comments
 (0)