Setting Fuel CMS up in Docker

I've not been able to find any implementations of Fuel CMS using Docker anywhere, so I wanted to ask if anyone can share an example?

I've tried implementing one myself but when I navigate to http://localhost/fuel/, I get "This site can’t be reached".

.env

Nginx

NGINX_HOST=localhost

PHP

See https://hub.docker.com/r/nanoninja/php-fpm/tags/

PHP_VERSION=latest

MySQL

MYSQL_VERSION=5.7.22
MYSQL_HOST=mysql
MYSQL_DATABASE=test
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD=root
MYSQL_USER=dev
MYSQL_PASSWORD=dev

Folder structure

.
├── Makefile
├── README.md
├── data
│ └── db
│ ├── dumps
│ └── mysql
├── doc
├── docker-compose.yml
├── etc
│ ├── nginx
│ │ ├── default.conf
│ │ └── default.template.conf
│ ├── php
│ │ └── php.ini
│ └── ssl
└── web
├── app
│ ├── composer.json.dist
│ ├── phpunit.xml.dist
│ ├── src
│ │ └── Foo.php
│ └── test
│ ├── FooTest.php
│ └── bootstrap.php

└── public <--- this where I've put all my fuel files
├── assets
├── fuel
├── .gitignore
├── .htaccess
├── index.php
├── README.md
└── robots.txt

docker-compose.yml

version: '3'
services:
web:
image: nginx:alpine
volumes:
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./etc/ssl:/etc/ssl"
- "./web:/var/www/html"
- "./etc/nginx/default.template.conf:/etc/nginx/conf.d/default.template"
ports:
- "8000:80"
- "3000:443"
environment:
- NGINX_HOST=${NGINX_HOST}
command: /bin/sh -c "envsubst '$$NGINX_HOST' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
restart: always
depends_on:
- php
- mysqldb
php:
image: nanoninja/php-fpm:${PHP_VERSION}
restart: always
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./web:/var/www/html"
composer:
image: "composer"
volumes:
- "./web/app:/app"
command: install
myadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
ports:
- "8080:80"
environment:
- PMA_ARBITRARY=1
- PMA_HOST=${MYSQL_HOST}
restart: always
depends_on:
- mysqldb
mysqldb:
image: mysql:${MYSQL_VERSION}
container_name: ${MYSQL_HOST}
restart: always
env_file:
- ".env"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
ports:
- "8989:3306"
volumes:
- "./data/db/mysql:/var/lib/mysql"

I've imported fuel.install/fuel_schema.sql and configured fuel/application/config/database.php to match the database.

I've logged into the php container and checked that the necessary folders are writable.

If I change $config['fuel_mode'] in MY_fuel.php, I get an error, so I've left that. $config['sess_save_path'] in config.php is left as NULL.

If anyone can help me understand what's going wrong or share an example of their own Docker implementations so that I can try and figure it out, I'd be grateful - I'm sure many other people would be too.

Comments

Sign In or Register to comment.