-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update on docker #18
base: main
Are you sure you want to change the base?
update on docker #18
Changes from all commits
121f87f
de7a53b
101d266
8d785a4
650dcf8
831ccbd
f203513
35c8260
97f6a3c
256d764
a30d5ca
5fef169
9b55236
995995f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
version: '2' | ||
services: | ||
mariadb: | ||
image: docker.io/bitnami/mariadb:10.6 | ||
platform: linux/arm64/v8 | ||
environment: | ||
# ALLOW_EMPTY_PASSWORD is recommended only for development. | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
- MARIADB_USER=bn_magento | ||
- MARIADB_DATABASE=bitnami_magento | ||
volumes: | ||
- 'mariadb_data:/bitnami/mariadb' | ||
magento: | ||
image: bitnami/magento:latest | ||
platform: linux/arm64/v8 | ||
ports: | ||
- '80:8080' | ||
- '443:8443' | ||
environment: | ||
- MAGENTO_HOST=localhost | ||
- MAGENTO_DATABASE_HOST=mariadb | ||
- MAGENTO_DATABASE_PORT_NUMBER=3306 | ||
- MAGENTO_DATABASE_USER=bn_magento | ||
- MAGENTO_DATABASE_NAME=bitnami_magento | ||
- ELASTICSEARCH_HOST=elasticsearch | ||
- ELASTICSEARCH_PORT_NUMBER=9200 | ||
# ALLOW_EMPTY_PASSWORD is recommended only for development. | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
volumes: | ||
- 'magento_data:/bitnami/magento' | ||
depends_on: | ||
- mariadb | ||
- elasticsearch | ||
elasticsearch: | ||
image: docker.io/bitnami/elasticsearch:7 | ||
platform: linux/arm64/v8 | ||
volumes: | ||
- 'elasticsearch_data:/bitnami/elasticsearch/data' | ||
volumes: | ||
mariadb_data: | ||
driver: local | ||
magento_data: | ||
driver: local | ||
elasticsearch_data: | ||
driver: local |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Name of the Magento container | ||
CONTAINER_NAME="magento-magento-1" | ||
|
||
# Ask for the username and password | ||
read -p "Enter Dropday Username: " USERNAME | ||
read -s -p "Enter Dropday Password: " PASSWORD | ||
echo | ||
|
||
# Enter the Magento Docker container | ||
docker exec -it $CONTAINER_NAME bash -c " | ||
# Set up authentication for Composer | ||
composer global config http-basic.repo.magento.com \"$USERNAME\" \"$PASSWORD\" | ||
|
||
# Navigate to the Magento directory | ||
cd /bitnami/magento/ | ||
|
||
# Use composer to install the Dropday extension | ||
composer require dropday-io/module-orderautomation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installing this extension with compose makes a copy of the master/main branch of this extension. While we want this Docker project to enable developers to work on their current branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the bash script created to install extension in the magento container because we need to install magento first in the container that was done on installing php apache magento and running all services there through a single image which is taken from public repo docker hub of bitnami. We can achieve this installation by creating docker file other then script but it will also doing the installtion through the script. The container have attached volume this extension will be stored in the volume this is the one time script running |
||
|
||
# Run Magento commands to setup and compile the extension | ||
bin/magento setup:upgrade | ||
bin/magento setup:di:compile | ||
bin/magento cache:clean | ||
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once the extension code base is mounted, I believe it will be installed automatically on installation. |
||
" | ||
|
||
echo "Dropday extension installation completed." | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Name of the Magento container | ||
CONTAINER_NAME="magento-magento-1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also assumes that the project lives inside a folder called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not the directory name. This is the name of the container which is set prior and will remain same everytime any one setup the code |
||
|
||
# Admin user details | ||
ADMIN_USER="admin-testing" | ||
ADMIN_PASSWORD="NewPass123" | ||
ADMIN_EMAIL="[email protected]" | ||
|
||
# Enter the Magento Docker container, create the admin user, and then display the result. | ||
docker exec -it $CONTAINER_NAME bash -c " | ||
echo 'Creating admin user...' | ||
magento admin:user:create --admin-user='$ADMIN_USER' --admin-password='$ADMIN_PASSWORD' --admin-email='$ADMIN_EMAIL' | ||
|
||
if [ \$? -eq 0 ]; then | ||
echo 'Admin user creation successful!' | ||
else | ||
echo 'Failed to create the admin user.' | ||
fi | ||
" | ||
|
||
echo "Script execution completed." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This target assumes the project is cloned in a directory called "magento". This project should be able to live in any directory name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the directory name. This is the name of the container which is set prior and will remain same everythime any one setup the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the name of the container is determine by the folder that is lives in.
So
magento-magento-1
is based on{directory}-{service}-{instance}
.I know this for a fact, because I ran the script from insude dropday-io-magento. And the name became
dropday-io-magento-magento-1
.