-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
11 changed files
with
577 additions
and
68 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,37 @@ | ||
# Dev Containers | ||
|
||
## Requirements | ||
|
||
- [Docker Engine](https://docs.docker.com/install/) | ||
- [Docker Compose V2](https://docs.docker.com/compose/cli-command/) | ||
- [mkcert](https://github.com/FiloSottile/mkcert) | ||
- [Visual Studio Code](https://code.visualstudio.com/) | ||
- Bash | ||
|
||
## Getting Start | ||
|
||
```sh | ||
# set up TLS certs and hosts in Host | ||
./init.sh www.dev.local store.dev.local | ||
|
||
# starting container or open folder in container | ||
docker compose up -d | ||
|
||
# install OpenMage | ||
./openmage/install.sh | ||
``` | ||
|
||
## Admin URLs | ||
|
||
- [OpenMage](https://store.dev.local/admin/) | ||
- [Joomla!](https://www.dev.local/administrator/) | ||
|
||
## Credentials | ||
|
||
- Username: `admin` | ||
- Password: `ChangeTheP@ssw0rd` | ||
|
||
## Setup | ||
|
||
- [OpenMage](./openmage/) | ||
- [Joomla!](./joomla/) |
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 |
---|---|---|
@@ -1,31 +1,90 @@ | ||
version: '2' | ||
|
||
name: magebridgecore_devcontainer | ||
services: | ||
joomla: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
VARIANT: "8.1-apache-bookworm" | ||
JOOMLA_VERSION: "3.10.11" | ||
context: ./joomla | ||
image: joomla:3.10-magebridge | ||
volumes: | ||
- ..:/workspace:cached | ||
- joomla-data:/var/www/html | ||
- ..:/workspace:cached | ||
- ./php.ini:/usr/local/etc/php/php.ini:ro | ||
- ./joomla/log:/var/www/html/administrator/logs | ||
environment: | ||
JOOMLA_DB_HOST: ${JOOMLA_DB_HOST:-mysql} | ||
JOOMLA_DB_PASSWORD: ${JOOMLA_DB_PASSWORD:-${MYSQL_ROOT_PASSWORD:-secret}} | ||
# https://xdebug.org/docs/all_settings | ||
XDEBUG_CONFIG: 'client_host=localhost log=/tmp/xdebug.log' | ||
XDEBUG_MODE: debug | ||
external_links: | ||
- traefik:store.dev.local | ||
labels: | ||
- traefik.enable=true | ||
- traefik.http.routers.joomla.entrypoints=websecure | ||
- traefik.http.routers.joomla.rule=Host(`www.dev.local`) | ||
depends_on: | ||
- mysql | ||
- traefik | ||
|
||
openmage: | ||
build: | ||
context: ./openmage | ||
image: openmage:1.9-magebridge | ||
volumes: | ||
- openmage-data:/var/www/html | ||
- ..:/var/www/html/.modman/MageBridge:cached | ||
- ./php.ini:/usr/local/etc/php/php.ini:ro | ||
- ./openmage/log:/var/www/html/var/log | ||
environment: | ||
JOOMLA_DB_HOST: mysql | ||
JOOMLA_DB_PASSWORD: secret | ||
# https://github.com/OpenMage/magento-lts/blob/32773dd4f82bb44bac89e8eca97379dad2a10af5/app/Mage.php#L22 | ||
# MAGE_IS_DEVELOPER_MODE: '1' | ||
# https://xdebug.org/docs/all_settings | ||
XDEBUG_CONFIG: 'client_host=localhost log=/tmp/xdebug.log' | ||
XDEBUG_MODE: debug | ||
external_links: | ||
- traefik:www.dev.local | ||
labels: | ||
- traefik.enable=true | ||
- traefik.http.routers.openmage.entrypoints=websecure | ||
- traefik.http.routers.openmage.rule=Host(`store.dev.local`) | ||
depends_on: | ||
- mysql | ||
- traefik | ||
|
||
mysql: | ||
# https://hub.docker.com/_/mysql | ||
image: mysql | ||
volumes: | ||
- mysql-data:/var/lib/mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: secret | ||
MYSQL_DATABASE: joomla | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-secret} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE:-openmage} | ||
ports: | ||
- 127.0.0.1:3306:3306 | ||
|
||
traefik: | ||
# https://hub.docker.com/_/traefik | ||
image: traefik | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock:ro | ||
- ./traefik/etc:/etc/traefik | ||
- ./certs:/etc/traefik/certs | ||
command: | ||
- --api.insecure=true | ||
- --api.dashboard=true | ||
- --entrypoints.web.address=:80 | ||
- --entrypoints.web.http.redirections.entryPoint.to=websecure | ||
- --entrypoints.web.http.redirections.entryPoint.scheme=https | ||
- --entrypoints.websecure.address=:443 | ||
- --entrypoints.websecure.http.tls=true | ||
- --providers.docker=true | ||
- --providers.docker.exposedByDefault=false | ||
- --providers.file.directory=/etc/traefik/dynamic/ | ||
ports: | ||
- 127.0.0.1:80:80 | ||
- 127.0.0.1:443:443 | ||
- 127.0.0.1:9090:8080 | ||
|
||
volumes: | ||
joomla-data: null | ||
mysql-data: null | ||
mysql-data: null | ||
openmage-data: null |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [ $# -le 0 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then | ||
echo "Usage: $0 <host> [<host>...]" | ||
exit 1 | ||
fi | ||
|
||
for host in "$@"; do | ||
if ! grep -q "${host}" /etc/hosts; then | ||
echo "127.0.0.1 ${host}" | sudo tee -a /etc/hosts | ||
fi | ||
done | ||
|
||
CURRENTDIR=$(dirname "$0") | ||
CERT_FILE="${CURRENTDIR}/certs/cert.pem" | ||
KEY_FILE="${CURRENTDIR}/certs/key.pem" | ||
|
||
if [ -e "${KEY_FILE}" ] && [ -e "${CERT_FILE}" ]; then | ||
echo "Certificate already exists" | ||
exit 0 | ||
fi | ||
|
||
if [ -z "$(command -v mkcert)" ]; then | ||
echo "mkcert is not installed, try 'brew install mkcert'" | ||
exit 1 | ||
fi | ||
|
||
mkcert -install | ||
mkdir -vp $(dirname "$CERT_FILE") | ||
mkcert -cert-file "$CERT_FILE" -key-file "$KEY_FILE" $@ |
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,66 @@ | ||
# Joomla! Setup | ||
|
||
## Extension Installation | ||
|
||
> System->Install->Extensions | ||
Upload Package File: `pkg_magebridge.zip` | ||
|
||
## Enable Extensions | ||
|
||
> System->Manage->Extensions | ||
- Plugin: `Authentication - MageBridge` | ||
- Plugin: `Content - MageBridge` | ||
- Plugin: `MageBridge - Core` | ||
- Plugin: `Magento - MageBridge` | ||
- Plugin: `System - MageBridge` | ||
- Plugin: `User - MageBridge` | ||
|
||
## Configuration | ||
|
||
> Components->`MageBridge`->Configuration | ||
### API | ||
|
||
- Hostname: `store.dev.local` | ||
- API User: `magebridge_api` | ||
- API Key: `ChangeTheAp1K3y` | ||
|
||
### Bridge | ||
|
||
- Protocol: `HTTPS` | ||
- Enforce SSL: `Entire site` | ||
|
||
### Users | ||
|
||
User synchronization | ||
|
||
- Magento Customer Group: `General` | ||
- Joomla! Usergroup: `Registered` | ||
- Username from Email: `Yes` | ||
|
||
User importing and exporting | ||
|
||
- Website: `Main Website (1)` | ||
- Customer Group: `General` | ||
|
||
## Add Root item | ||
|
||
> Menus->`Main Menu`->`Add New Menu Item` | ||
### Details | ||
|
||
- Title: `Store` | ||
- Alias: `store` | ||
- Menu Item Type: `MageBridge`->`Root` | ||
|
||
### Magento Scope | ||
|
||
- Store/Store View: `English(default)` | ||
|
||
## System Check | ||
|
||
> Components->`MageBridge`->`System Check` | ||
Ensure all necessary checks have passed! |
Oops, something went wrong.