Sign inSign up

h5tec/joomla

By h5tec

•Updated about 7 years ago

Joomla Docker Container by H5.Technology

Image
0

1.0K

h5tec/joomla repository overview

⁠Joomla Container

by H5.Technology [[email protected]]

debian:stretch joomla:3.9.10 php:7.2 apache2

⁠PHP 7.2 Packages

cli curl gd mysql zip xml ldap mbstring common json opcache readline intl fpm bz2 mysqli pgsql

⁠Included
  • php.ini
memory_limit = 256M
post_max_size = 32M
date.timezone = Europe/Berlin
upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 60
extension = apcu.so
extension = memcached.so
extension = redis.so
  • apache2.conf
<IfModule mod_env.c>
  SetEnv HTTPS on
</IfModule>
⁠Run Container by CommandLine
docker run -d --restart=always --name myjoomla -p 8080:80 -v /dock/data/myjoomla/logs:/var/log/apache2 -v /dock/data/myjoomla/html:/var/www/html/joomla enbucm/joomla
⁠Compose Joomla together with MySQL and PHPmyAdmin
  • docker-compose.yaml
version: "3.1"

services:

  joomla:
    container_name: joomla
    image: h5tec/joomla
    restart: always
    links:
      - mysql:mysql
    ports:
      - 8001:80
    environment:
      JOOMLA_DB_NAME:   YourDBName
      JOOMLA_DB_USER:   YourDBUser
      JOOMLA_DB_PASS:   YourDBPass
      JOOMLA_DB_HOST:   mysql
    volumes:
      - joomla_html:/var/www/html
      - joomla_logs:/var/log/apache2

  mysql:
    container_name: mysql
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: YourRootPass
      MYSQL_DATABASE: YourDBName
      MYSQL_USER: YourDBUser
      MYSQL_PASSWORD: YourDBPass

  phpmyadmin:
    container_name: phpmyadmin
    image: phpmyadmin/phpmyadmin
    restart: always
    links:
      - mysql:mysql
    ports:
      - 9001:80
    environment:
      MYSQL_USERNAME: root
      MYSQL_ROOT_PASSWORD: YourDBRootPass
      PMA_HOST: mysql

volumes:
  joomla_html:
  joomla_logs:
⁠Full Enviroment
  • Install packages
apt install -y ufw nginx python-certbot-nginx
  • Configure UFW [Uncomplicated FireWall]
ufw allow 'Nginx Full'
  • Create Nginx Congfiguration change example.org to your domainname
    nano /etc/nginx/conf.d/example.org.conf
server {
  listen 80;
  server_name example.org;
  location /.well-known/acme-challenge/ {
    root /var/www/certbot;
  }
  location / {
    return 301
    https://$host$request_uri;
  }
}
server {
  listen 443 ssl;
  server_name example.org;
  location / {
    proxy_pass         http://localhost:8001;
    proxy_redirect     http:// https://;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
  }
  client_max_body_size 16M;
  # SSL certificate path will be added by certbot automaticly
}
  • Check nginx configuration nginx -t
  • Restart nginx service nginx restart
  • Optain LetsEncrypt Certificate
certbot --nginx -d example.org
⁠Compose Up Environment
  • Change directory to the path docker-compose.yaml lies in

cd pathtoDockerComposeFIle

  • Compose up

docker-compose up -d

docker-compose down

...f i n i s h e d

Certbot check for new certificate twice a day via
/etc/systemd/system/timers.target.wants/certbot.timer

Certbot timer status can be checked with
systemctl status certbot.timer

⁠JUST IN CASE
  • How to install docker on debian:stretch
sudo apt-get update
sudo apt-get install -y \
    dirmngr \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \
    software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
  • How to install docker-compose?
curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo docker-compose --version
  • Make docker ps bit nicer
alias docks='docker ps --format="table {{.ID}}\t{{.Status}}\t{{.Names}}"'

so, just use docks to see runnnig container, or use docks -a
and may add this code to ~/.profile

Tag summary

Content type

Image

Digest

Size

263.6 MB

Last updated

about 7 years ago

docker pull h5tec/joomla