Helloooooo,
Im trying myself at using docker with modx. Could not find any prefab modx-images, so I started out making things a bit on my own but got halted by the error: modxubuntu exited with code 0
Does anyone know some sweet docker-setup? Would be great to have
Anyway here is what I got now, would be thankful for help!
This is my docker-compose file:
version: '3'
services:
mysql:
image: mariadb
volumes:
- /website/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: rebecca_modx31
MYSQL_DATABASE: rebeccamodx
MYSQL_USER: rebecca
restart: always
modx:
build: ./modxubuntu
container_name: modxubuntu
volumes:
- /website/data:/var/www/html
depends_on:
- mysql
links:
- mysql
restart: always
nginx:
image: nginx:alpine
container_name: modxnginx
volumes:
- /website/nginx:/etc/nginx/conf.d
- /website/data:/var/www/html
ports:
- 8080:80
- 443:443
links:
- modx
and here is my Dockerfile to extend the ubuntu image and pull the latest version of modx on it:
FROM ubuntu
ENV TZ=Europe/Berlin
RUN apt-get update \
&& echo "setting timezone" \
&& apt-get install -y tzdata \
&& ln -fs /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& echo "setting timezone was a success" \
&& apt-get install -y apt-utils wget zip unzip \
&& mkdir -p /var/www/html \
&& cd /var/www/html \
&& wget https://modx.com/download/downloading?id=60b109a106a0b762003d3162 \
&& chown -R www-data:www-data /var/www/html/ \
&& apt-get install -y php php-cli php-common php-mbstring php-gd php-intl php-xml php-mysql php-zip php-curl php-xmlrpc \
&& echo "done"