Docker: WordPress with Nginx – PHP-FPM -MariaDB

I’ve created a docker-compose file to run a wordpress stack based on:
Nginx with PHP-fpm and MariaDB.

In the image I change the max_upload to 40MB.

I’m using the latest wordpress:fpm image to build it.
The dockerfile is included on my Github.

I’m using Traefik to expose the nginx container to the outside.
(my network for that is called: Proxy)

The stack below uses my wordpress image.
If you want to create it yourself then:
-clone the repo
-change the lines in dockerfile ( for the wordpress container) to:

    wordpress:
        build: ..
        #image: back2basic/wordpress  
        volumes:
            - ./wordpress:/var/www/html

if you choose to run my image then clone the repo and bring up the stack. ( image is build for x86)

Here the stack to run in docker-compose:

version: '3.6'

networks: 
    Backend:
        internal: true
    Proxy:
        external: true

services:
    mysql:
        image: mariadb
        volumes:
            - ./db-data:/var/lib/mysql
            - ./backup:/backupData
        environment:
            MYSQL_ROOT_PASSWORD: wordpress
        ports:
            - 3306
        networks: 
            - Backend
        deploy:
            replicas: 1
            placement:
                constraints:
                    - node.role != manager
            update_config:
                parallelism: 1
                delay: 30s
                order: start-first
            
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        environment:
            PMA_HOST: mysql
        ports:
            - 80
        networks: 
            - Backend
            - Proxy
        deploy:
            replicas: 0
            placement:
                constraints:
                    - node.role != manager
            update_config:
                parallelism: 1
                delay: 30s
                order: start-first
            labels:
                traefik.port: 80
                traefik.frontend.rule: "Host:php.proxy.example.com"
                traefik.docker.network: "Proxy"

    wordpress:
        #build: ..
        image: back2basic/wordpress  
        volumes:
            - ./wordpress:/var/www/html
        environment:
            WORDPRESS_DB_NAME: wordpress
            WORDPRESS_TABLE_PREFIX: wp_
            WORDPRESS_DB_HOST: wordpress
            WORDPRESS_DB_USER: wordpress
            WORDPRESS_DB_PASSWORD: wordpress
        links:
            - mysql
        ports:
            - 9000
        networks: 
            - Backend
        deploy:
            replicas: 1
            placement:
                constraints:
                    - node.role != manager
            update_config:
                parallelism: 1
                delay: 30s
                order: start-first

    nginx:
        image: nginx:latest
        ports:
            - 80
        volumes:
            - ../nginx.conf:/etc/nginx/nginx.conf
            - ./nginx:/etc/nginx/conf.d
            - ./logs/nginx:/var/log/nginx
            - ./wordpress:/var/www/html
        links:
            - wordpress
        networks:
            - Backend
            - Proxy
        deploy:
            replicas: 1
            placement:
                constraints:
                    - node.role != manager
            update_config:
                parallelism: 1
                delay: 30s
                order: start-first
            labels:
                traefik.port: 80
                traefik.frontend.rule: "Host:www.example.com,example.com"
                traefik.docker.network: "Proxy"
        healthcheck:
            test: ["CMD", "curl", "-f", "http://localhost"]
            interval: 1m30s
            timeout: 10s
            retries: 5
start_period: 15s

Link to the repo: https://github.com/back2basic/wordpress.git

Raspberry Pi and Docker Swarm

I still had a bunch of Raspberry Pi2 not doing anything for a while.
So I started a new Project to run a little cluster of Raspberry’s

my goal is to run most of my docker containers I use on a daily base of the Pi.

we start with a fresh rasbian-lite image.

First we update all the Pi’s in the cluster:

sudo apt update && sudo apt dist-upgrade -y

Install Docker:

sudo apt-get install apt-transport-https ca-certificates software-properties-common -y
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
sudo usermod -aG docker pi
sudo curl https://download.docker.com/linux/raspbian/gpg

sudo nano /etc/apt/sources.list

Add the following line and save:  

deb https://download.docker.com/linux/raspbian/ stretch stable

Update and start the services:

sudo apt-get update
sudo apt-get upgrade

systemctl start docker.service
systemctl enable docker.service

docker info

Create the swarm on 1 node:

docker swarm init

on the rest of the node join the swarm.

Have fun 😉

Nice case to carry your tiny whoop with radio and goggles

Handbag Backpack Bag Case for Blade Inductrix Tiny Whoop Eachine QX90 QX95 E010 Fatshark FPV GogglesIf your searching for a solid case ?? this is the right spot..
Take a look at this one.

It’s a sturdy case with room to fit in most radio’s.
There a inlays in the case that you can remove to make everything fit snugly.
Because of this there is also room for 2 tiny whoops.
Below the quads you can store your batteries and other equipment you need ( for example your changer.)

Next to the whoops you can store also you favorite goggles in this case.

Starting a new hobby for a round 250 euro: Flying with Quad-copters

I wanted to try something new and exiting so after many hours watching Youtube video’s and reading forums I decided to go for it and purchase my first Quad copter.

Snapper 6
Snapper 6

The one I selected wasn’t really 250 Euro, the quad costs around 75 but….
That’s not the only thing you need if you’ve never operated an real RC tool.

There are some cheap quads that come with a transmitter to operate it but the quality from that is not really great ( maybe for a kid it’s alright but i expect a little bit more.)
for a transmitter I decided to go for the FrSky X-Lite, that is a nice format to start with with all features you need to control it.

Don’t forget that you also need batteries for you transmitter, you’ll need 18500 for this one. 1 pair should be more then enough for the beginning hopefully.
you also need something to charge the 18500 so I ordered a charger also.

Continue reading “Starting a new hobby for a round 250 euro: Flying with Quad-copters”

OsCam compiled on Raspberry Pi and use for Ziggo TV

I started of with the latest raspbian lite image since I don’t need a GUI for this.

After the image is created you need to copy an empty file with the name ‘ssh’ to the boot partition ( else you can’t ssh into the Pi)

Let’s upgrade it before we start compiling:

sudo apt update && sudo apt dist-upgrade -y
sudo rpi-update
reboot

Continue reading “OsCam compiled on Raspberry Pi and use for Ziggo TV”

Aquarium Controller – Custom PCB – Arduino Mega – MySensors – Domoticz – Part2

The PCB is ready. received it last week.
Currently I’m busy with 3d printing the enclosure.
I switched from having 2 Arduino Mega to just one.
Still trying to figure out how I’m going to code this but that will be a challenge for tomorrow.

I’ll also upload the schema for the PCB here( Probably call it MyMegaAquaControl v0.1)

 

Aftersome testing i can’t get the radio to work even not in simple relay mode.
I’m trying to figure out what whent wrong in the process and hope I can correct it, else I probably have to redesign the complete PCB ( already found another issue with the dimmers so might create a new one soon)

 

Recently i build a new version based on the Raspberry pi 3a as main compute unit to control the aquarium.

That worked a lot better so far..

more to come.. in part 3 …

via GIPHY

Aquarium Controller – Custom PCB – 2x Arduino Mega – MySensors – Domoticz

I always enjoy the view of my aquarium ( still after more then 10 Years)
But 1 thing about this hobby I never liked…
And that is monitoring the water and the actual weekly water changes.

Last year I noticed the project MySensors over @ https://mysensors.org because I was playing around with my home automation system ( https://domoticz.com)

And suddenly the idea came to create an Aquarium Controller based on the MySensors Project and Controlled by Domoticz.
I started ordering all sorts of components from E-bay to play around with and build a little setup that is able to control my LED Strips / the High Power(10W) Leds / and monitor the temperature of the water and the surroundings.(ph and TurbiditySensor are on its way)

On the picture ( it’s probably hard to see because of the cable mess) are 3 small arduino’s 

  • Monitoring Temp
  • controlling Relais ( for 12V PWM LED Drivers)
  • Controlling Fans ( pwm)

This was done to see if all would run stable and kept running for months.
So far I’ve had no issues and all boards are running nicely. So I’m ready for the next phase of the project.

That is to build a custom PCB where I can fit on 2 Arduino Mega’s to control and monitor the majority of the aquarium ( Changing water will be a sepperate PCB – And I still need to figure out the waterpipes I need to create for that.)
Next I downloaded Fritzing and started playing around with the components until i had a nice PCB that I could use ( This process took me about a month.)

What’s all on the board?

  • 2x RGB control
  • 4x PWM Fan Control and FanSpeed Monitoring
  • Turbidity sensor input
  • PH-Probe Sensor input
  • OneWire ( Temp.)
  • 8x Relais Controls
  • ATX PSU Control
  • Connection for backup power 5v( small powerbank ) – just in case the power goes out one of the arduino’s would still keep running.
  • 3x Volt meters ( 12v / 5v / 5vStandby)

I’m now in the process of putting the finishing touches on the PCB( labeling all components correct with their values) 

Issues to resolve before the board can be created:

  1. I should somehow be able to control the  LED drivers over PWM but I’m still working on that part since the driver requires a 12V PWM signal and the arduino send a 5V PWM signal it won’t work. gotta find something for that .. 

More to come Soon…

raspi-config on kali to expand your filesystem

pi2This article explains how to use expand_roofs from the raspi-config tool when your raspberry pi2 is running Kali Linux.

First we download the package:

wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20121028_all.deb

and install it with:

dpkg -i ./raspi-config_20121028_all.deb

it will probably throw an error back at you … you can fix that with:

apt-get install -f -y

now you can run:

raspi-config

and use expand_rootfs and use your full sd card..

Have fun 😉