Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Joomla! Development",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "joomla"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
"onCreateCommand": "sudo chmod +x .devcontainer/install-tools.sh && .devcontainer/install-tools.sh",
"postCreateCommand": "sudo chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh",
"forwardPorts": [
8080
],
"remoteUser": "joomla"
}
32 changes: 32 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
services:
app:
image: joomla:4.4.8-apache
restart: always
ports:
- 8080:80
environment:
JOOMLA_DB_HOST: db
JOOMLA_DB_USER: joomla
JOOMLA_DB_PASSWORD: examplepass
JOOMLA_DB_NAME: joomla_db
JOOMLA_SITE_NAME: Joomla
JOOMLA_ADMIN_USER: Joomla Hero
JOOMLA_ADMIN_USERNAME: joomla
JOOMLA_ADMIN_PASSWORD: joomla@secured
JOOMLA_ADMIN_EMAIL: joomla@example.com
volumes:
- ../..:/workspaces:cached

db:
image: mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: joomla_db
MYSQL_USER: joomla
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: "1"
volumes:
- db:/var/lib/mysql

volumes:
db:
10 changes: 10 additions & 0 deletions .devcontainer/install-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -eux

echo "Installing chromium..."
sudo apt-get update
sudo apt-get -y install --no-install-recommends chromium

# Copy the welcome message
sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
11 changes: 11 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -eux

if [ -z ${CODESPACE_NAME+x} ]; then
SITE_HOST="http://localhost:8080"
else
SITE_HOST="https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
fi

# Install dependencies
5 changes: 5 additions & 0 deletions .devcontainer/welcome-message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
👋 Welcome to "Joomla! Development" in Codespaces!

🛠️ Your environment is fully setup with all the required software.

🚀 To get started, wait for the "postCreateCommand" to finish setting things up, then open the portforwarded URL and append '/administrator'.