Docker containers for different php versions

I am new to docker …

I want to user docker on a new droplet at digital ocean. I did decide to use Ubuntu 16.04.2 (NOT the docker droplet).

We want to bring three different web sites to that droplet, which have been created from different web designers with different php versions: php5.6 and php7.1, in addition we need mysql for all web sites, including wordpress and phpmyadmin. We want to use nginx.

Is there a sample setup somewhere I can start to follow to achieve above?

Hello there,

That’s a LEMP (Linux, NginX [Pronounced as Engine X], MySQL, PHP) stack. I’ve previously asked it too but I didn’t seem to get a reply. But, since I’m here, please try this: https://www.youtube.com/watch?v=M1j41ud2O-M

Tell me if it works on your side. I am currently having a lot of problem with mine

Regards,
CrAzYz_ (Zypeth)

Am I on the right path with that yaml file?

nano docker-compose.yml

version: ‘2’

services:
db:
image: mariadb
command: mysqld --innodb-buffer-pool-size=20M
restart: always
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- back

wordpress:
depends_on:
- db
image: wordpress:latest
restart: always
volumes:
- ./wp-content:/var/www/html/wp-content
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
ports:
- “8080:80”
- "8443:8443"
networks:
- back

phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 8081:80
environment:
PMA_HOST: database
MYSQL_ROOT_PASSWORD: root
networks:
- back

web:
image: nginx
volumes:

  • ./mysite.template:/etc/nginx/conf.d/mysite.template
    ports:
  • "8080:80"
    environment:
  • NGINX_HOST=foobar.com
  • NGINX_PORT=80
    command: /bin/bash -c “envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g ‘daemon off;’”

networks:
back:

volumes:
db_data:

Hello there,

Your docker-compose.yml look like a Docker Machine setup instead of a normal Host Setup.
Anyway, I have managed to create a working LEMP Stack on Docker – would you like to have a copy?

Also, your docker-compose.yml seem too complicated for a Host Setup but if it works for you, go ahead and use it.

Regards,
CrAzYz_ (Zypeth)

yes, please. I try everything to figure it out. lol