awesoft / magento-docker
Magento 2 docker image
Fund package maintenance!
Buy Me A Coffee
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Shell
Type:magento2-component
Requires
- php: ^8.2
- magento/magento2-base: ^2.4
Conflicts
- magento/magento-cloud-docker: *
README
A lightweight, open-source Docker container for Magento2, tailored for a standard setup.
Disclaimer
- This container provides a minimal setup using
alpine
Linux and thesh
shell, rather thanbash
. - It is designed for Magento Open Source projects and might conflict with Magento ECE Tools, which also offers Docker Compose files.
Requirements
- Installed
magento2-base
(or an existing Magento2 project) - PHP version 8.2
Installation
- Via Composer
composer require awesoft/magento-docker:^8.2
Usage
- The setup is designed to be straightforward. Additional configurations are optional and based on your specific needs.
- After installation via Composer, simply run
docker compose up
to start all necessary services automatically. Refer todocker-compose.yml
for details.
Files Created
docker-compose.yml
- Specifies the services, volumes, and configurations to initiate your Magento2 instance..docker/mariadb
- Includes configuration files for a MariaDB database instance..docker/nginx
- Contains the Nginx server template configuration.
Access & Services
- Your Magento website will be accessible by default at http://magento.local/:
- Add
127.0.0.1 magento.local
to your/etc/hosts
file manually. - Change the domain in
.docker/nginx/templates/default.conf.template
if needed.
- Add
- Mailcatcher: http://127.0.0.1:1080
- Opensearch: http://127.0.0.1:9200
- Redis: http://127.0.0.1:6379
- Check
docker-compose.yml
for more information.
Additional Command and Configuration
- Use the
run-install
command to executesetup:install
with default options, ideal for a fresh Magento project.docker compose exec -it php run-install
- If successful, you can access the admin page with the following credentials:
- http://magento.local/admin/
- Username:
admin
- Password:
P@ssw0rd
- By default, the
xdebug
module is disabled. To enable it, add aXDEBUG_MODE
environment variable in your docker-compose.yml file.