-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
201554d
commit 700fad9
Showing
15 changed files
with
226 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ko_fi: alexcheng1982 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
FROM ghcr.io/alexcheng1982/docker-apache2-php8:8.1 | ||
|
||
LABEL maintainer="alexcheng1982@gmail.com" | ||
LABEL php_version="8.1" | ||
LABEL magento_version="2.4.6-p5" | ||
LABEL description="Magento Open Source 2.4.6-p5 with PHP 8.1" | ||
|
||
ENV MAGENTO_VERSION 2.4.6-p5 | ||
ENV INSTALL_DIR /var/www/html | ||
ENV COMPOSER_HOME /var/www/.composer/ | ||
|
||
RUN curl -sS https://getcomposer.org/installer | php \ | ||
&& mv composer.phar /usr/local/bin/composer | ||
COPY ./auth.json $COMPOSER_HOME | ||
|
||
RUN requirements="libpng++-dev libzip-dev libmcrypt-dev libmcrypt4 libcurl3-dev libfreetype6 libjpeg-turbo8 libjpeg-turbo8-dev libfreetype6-dev libicu-dev libxslt1-dev zip unzip libxml2 libonig-dev" \ | ||
set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y $requirements; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN set -eux; \ | ||
docker-php-ext-install pdo_mysql; \ | ||
docker-php-ext-configure gd --with-freetype --with-jpeg; \ | ||
docker-php-ext-install gd; \ | ||
docker-php-ext-install mbstring; \ | ||
docker-php-ext-install zip; \ | ||
docker-php-ext-install intl; \ | ||
docker-php-ext-install xsl; \ | ||
docker-php-ext-install soap; \ | ||
docker-php-ext-install sockets; \ | ||
docker-php-ext-install bcmath | ||
|
||
RUN yes '' | pecl install mcrypt-1.0.6 \ | ||
&& echo 'extension=mcrypt.so' > /usr/local/etc/php/conf.d/mcrypt.ini | ||
|
||
RUN chsh -s /bin/bash www-data | ||
|
||
RUN chown -R www-data:www-data /var/www | ||
|
||
RUN su www-data -c "COMPOSER_MEMORY_LIMIT=-1 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition $INSTALL_DIR $MAGENTO_VERSION" | ||
|
||
RUN cd $INSTALL_DIR \ | ||
&& find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + \ | ||
&& find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + \ | ||
&& chown -R :www-data . \ | ||
&& chmod u+x bin/magento | ||
|
||
COPY ./install-magento /usr/local/bin/install-magento | ||
RUN chmod +x /usr/local/bin/install-magento | ||
|
||
COPY ./install-sampledata /usr/local/bin/install-sampledata | ||
RUN chmod +x /usr/local/bin/install-sampledata | ||
|
||
RUN a2enmod rewrite | ||
RUN echo "memory_limit=2048M" > /usr/local/etc/php/conf.d/memory-limit.ini | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
WORKDIR $INSTALL_DIR | ||
|
||
VOLUME $INSTALL_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"http-basic": { | ||
"repo.magento.com": { | ||
"username": "5310458a34d580de1700dfe826ff19a1", | ||
"password": "255059b03eb9d30604d5ef52fca7465d" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: '3.0' | ||
services: | ||
web: | ||
image: ghcr.io/alexcheng1982/docker-magento2:2.4.6-p5 | ||
ports: | ||
- "80:80" | ||
links: | ||
- db | ||
- opensearch | ||
depends_on: | ||
- db | ||
- opensearch | ||
volumes: | ||
- magento-data:/var/www/html | ||
env_file: | ||
- env | ||
db: | ||
image: mysql:8.0.0 | ||
volumes: | ||
- db-data:/var/lib/mysql | ||
env_file: | ||
- env | ||
phpmyadmin: | ||
image: phpmyadmin/phpmyadmin | ||
ports: | ||
- "8580:80" | ||
links: | ||
- db | ||
depends_on: | ||
- db | ||
opensearch: | ||
image: opensearchproject/opensearch:2 | ||
environment: | ||
- cluster.name=opensearch-cluster | ||
- node.name=opensearch | ||
- discovery.seed_hosts=opensearch | ||
- cluster.initial_cluster_manager_nodes=opensearch | ||
- bootstrap.memory_lock=true | ||
- plugins.security.disabled=true | ||
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
volumes: | ||
- opensearch-data:/usr/share/opensearch/data | ||
ports: | ||
- 9200:9200 | ||
- 9600:9600 | ||
volumes: | ||
magento-data: | ||
db-data: | ||
opensearch-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MYSQL_HOST=db | ||
MYSQL_ROOT_PASSWORD=myrootpassword | ||
MYSQL_USER=magento | ||
MYSQL_PASSWORD=magento | ||
MYSQL_DATABASE=magento | ||
|
||
MAGENTO_LANGUAGE=en_GB | ||
MAGENTO_TIMEZONE=Pacific/Auckland | ||
MAGENTO_DEFAULT_CURRENCY=NZD | ||
MAGENTO_URL=http://local.magento | ||
MAGENTO_BACKEND_FRONTNAME=admin | ||
MAGENTO_USE_SECURE=0 | ||
MAGENTO_BASE_URL_SECURE=0 | ||
MAGENTO_USE_SECURE_ADMIN=0 | ||
|
||
MAGENTO_ADMIN_FIRSTNAME=Admin | ||
MAGENTO_ADMIN_LASTNAME=MyStore | ||
MAGENTO_ADMIN_EMAIL=amdin@example.com | ||
MAGENTO_ADMIN_USERNAME=admin | ||
MAGENTO_ADMIN_PASSWORD=magentorocks1 | ||
|
||
OPENSEARCH_HOST=opensearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
su www-data <<EOSU | ||
/var/www/html/bin/magento setup:install \ | ||
--base-url=$MAGENTO_URL \ | ||
--backend-frontname=$MAGENTO_BACKEND_FRONTNAME \ | ||
--language=$MAGENTO_LANGUAGE \ | ||
--timezone=$MAGENTO_TIMEZONE \ | ||
--currency=$MAGENTO_DEFAULT_CURRENCY \ | ||
--db-host=$MYSQL_HOST \ | ||
--db-name=$MYSQL_DATABASE \ | ||
--db-user=$MYSQL_USER \ | ||
--db-password=$MYSQL_PASSWORD \ | ||
--use-secure=$MAGENTO_USE_SECURE \ | ||
--base-url-secure=$MAGENTO_BASE_URL_SECURE \ | ||
--use-secure-admin=$MAGENTO_USE_SECURE_ADMIN \ | ||
--admin-firstname=$MAGENTO_ADMIN_FIRSTNAME \ | ||
--admin-lastname=$MAGENTO_ADMIN_LASTNAME \ | ||
--admin-email=$MAGENTO_ADMIN_EMAIL \ | ||
--admin-user=$MAGENTO_ADMIN_USERNAME \ | ||
--admin-password=$MAGENTO_ADMIN_PASSWORD \ | ||
--use-rewrites=1 \ | ||
--search-engine=opensearch \ | ||
--opensearch-host=$OPENSEARCH_HOST \ | ||
--opensearch-port=9200 \ | ||
--opensearch-index-prefix=magento2 \ | ||
--opensearch-timeout=15 \ | ||
--opensearch-enable-auth=false | ||
/var/www/html/bin/magento cron:install --force | ||
/var/www/html/bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth | ||
/var/www/html/bin/magento cache:flush | ||
EOSU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
su www-data <<EOSU | ||
/var/www/html/bin/magento sampledata:deploy | ||
/var/www/html/bin/magento setup:upgrade | ||
EOSU |