-
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 3 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: alexcheng/magento2 | ||
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/magento2-extension | ||
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. Can you mount it as a volume to this current repo, because the purpose is to develop on the extension with Docker as develop environment. 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. Resolve this issue. |
||
|
||
# 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." | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Setting Up Your Magento Environment | ||
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. Can you update the README.md and make it in the same style. Place it at the bottom, under the title "Test and Developing with Docker" |
||
|
||
Starting Services: | ||
|
||
Initiate your Docker containers by executing the following command: | ||
|
||
docker-compose up -d | ||
|
||
Verifying Container Names: | ||
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. What about the container names?
|
||
|
||
After initiating the containers, it's recommended to confirm their names. You can list the active containers using: | ||
|
||
docker ps | ||
|
||
Admin User Setup: | ||
|
||
Before you proceed, ensure that you modify the container name in the script to match the actual name of your Magento container. Once done, execute the password setup | ||
script: | ||
|
||
sh password.sh | ||
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. Can you automate this process. Read #14 again. It's all about reproducibility of this extension. Too many manual steps will cause human error. 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.
|
||
|
||
Accessing the Admin Dashboard: | ||
|
||
You can access the Magento admin dashboard by navigating to: | ||
|
||
localhost/admin | ||
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. Not reachable at all. |
||
|
||
Installing Dropday Extension: | ||
|
||
To add the Dropday extension to your Magento setup, run the following script: | ||
|
||
sh install-dropday.sh |
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
.