-
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.
Merge pull request #37 from akunzai/dev-containers
Improve Joomla! 4 compatibility
- Loading branch information
Showing
435 changed files
with
5,600 additions
and
4,698 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
# 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 | ||
|
||
# start containers | ||
docker compose up -d | ||
|
||
# install OpenMage | ||
./openmage/install.sh | ||
|
||
# install the Joomla! (requires Joomla! version >= 4.3) | ||
./joomla/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
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,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# https://mcr.microsoft.com/v2/vscode/devcontainers/php/tags/list | ||
ARG PHP_VERSION=8.2 | ||
# https://hub.docker.com/_/joomla | ||
ARG JOOMLA_VERSION=4.4.0 | ||
|
||
FROM joomla:${JOOMLA_VERSION}-apache AS joomla | ||
|
||
# https://hub.docker.com/_/php | ||
FROM php:${PHP_VERSION}-apache-bookworm | ||
|
||
ENV LANG=en_US.UTF-8 | ||
|
||
# install MySQL client | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends default-mysql-client \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# install pickle | ||
# https://github.com/FriendsOfPHP/pickle | ||
RUN set -eux; \ | ||
curl -Lo /usr/local/bin/pickle https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar && \ | ||
chmod +x /usr/local/bin/pickle; | ||
|
||
# install the PHP extensions we need | ||
RUN set -eux; \ | ||
savedAptMark="$(apt-mark showmanual)"; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
libfreetype6-dev libicu-dev libjpeg62-turbo-dev \ | ||
libpng-dev libxml2-dev libxslt1-dev libzip-dev libwebp-dev \ | ||
${PHP_EXTRA_BUILD_DEPS:-}; \ | ||
# https://www.php.net/manual/en/image.installation.php | ||
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \ | ||
docker-php-ext-install -j$(nproc) opcache \ | ||
intl gd mysqli pcntl pdo_mysql soap xsl zip; \ | ||
pickle install --no-interaction apcu; \ | ||
pickle install --no-interaction redis; \ | ||
pickle install --no-interaction xdebug; \ | ||
docker-php-ext-enable apcu opcache redis xdebug; \ | ||
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies | ||
apt-mark auto '.*' > /dev/null; \ | ||
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ | ||
find /usr/local -type f -executable -exec ldd '{}' ';' \ | ||
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \ | ||
| sort -u \ | ||
| xargs -r dpkg-query --search \ | ||
| cut -d: -f1 \ | ||
| sort -u \ | ||
| xargs -r apt-mark manual; \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ | ||
rm -rf /var/lib/apt/lists/*; | ||
|
||
# set up Apache2 | ||
RUN set -eux; \ | ||
# enable Apache2 modules | ||
a2enmod rewrite expires include deflate remoteip headers; \ | ||
# disable Apache2 server signature | ||
echo 'ServerSignature Off' >> /etc/apache2/apache2.conf; \ | ||
echo 'ServerTokens Prod' >> /etc/apache2/apache2.conf; \ | ||
# enable support for TLS termination | ||
echo 'SetEnvIf X-Forwarded-Proto https HTTPS=on' >> /etc/apache2/apache2.conf; | ||
|
||
# install composer | ||
# https://hub.docker.com/_/composer | ||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer | ||
|
||
# set up Joomla! | ||
# Disable remote database security requirements. | ||
ENV JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK=1 | ||
COPY --from=joomla /entrypoint.sh / | ||
COPY --from=joomla /makedb.php / | ||
COPY --from=joomla --chown=www-data:www-data /usr/src/joomla /usr/src/joomla | ||
RUN set -eux; \ | ||
chown -R www-data:www-data /usr/src/joomla; \ | ||
chmod -R g+w /usr/src/joomla; | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["apache2-foreground"] |
Oops, something went wrong.