Giter Site home page Giter Site logo

lemp-docker's Introduction

LNMP

This is an image with Linux (Ubuntu 18.04 LTS), Nginx, MySQL and PHP-FPM

Features

  • Multi Version: All supported PHP versions available
  • Up-to-Date: Images auto-updated every week
  • Secure: Cron job auto installed into containers to apply security updates every night;
  • Green light to send emails: PHP mail() working like a charm;
  • Schedule jobs: cron command installed;

Ready-to-go images

Check out on Docker Hub

Source code on GitHub

Using this image

Just create a docker-compose.yml on your application root path and run

docker-compose up -d

Configure your mysql database access to host 127.0.0.1, username root, no password and to database app

Your main application will be accessible on http://localhost/ and phpmyadmin on http://localhost/pma/

Note: If you are using zend framework 1 or 2, just modify docker-compose.yml volume to ./:/app/

The docker-compose.yml file

web:
 image: fbraz3/lnmp
 volumes:
 - ./:/app/public/
 ports:
 - "127.0.0.1:80:80"
 - "127.0.0.1:3306:3306"

Sending Emails

First of all, create a network called dockernet using range 192.168.0.0/24 to get emails working over ssmtp email proxy.

# docker network create --subnet=192.168.0.0/24 dockernet

edit /etc/postfix/main.cf and add 192.168.0.0/24 on mynetworks params.

mynetworks = 127.0.0.0/8 192.168.0.0/24 [::ffff:127.0.0.0]/104 [::1]/128

Restart postfix

systemctl restart postfix

Cronjob

System reads /cronfile file and installs using cron.

To use it just add your commands to a single file and bind it to /cronfile as follows.

  [...]
     volumes:
        - /my/app/root/:/app
        - /my/cronfile:/cronfile
  [...]

TAGS

  • tag name = PHP Version
  • latest = PHP 8.3

lemp-docker's People

Contributors

fbraz3 avatar iii80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lemp-docker's Issues

how to mount the nginx/php log and the MySQL database

I create a docker compose file

version: '3.8'  
services:
  web:
    image: fbraz3/lnmp
    volumes:
      - ./:/app/public/
    ports:
      - "127.0.0.1:8081:80"
      - "127.0.0.1:3306:3306"

Shall I put something under volumes to check the logs and save the database in the host?

BR,Austin

mysql cann't start

docker-entrypoint.sh
/etc/init.d/mysql restart
modify
/etc/init.d/mariadb restart

Mysql won't start

Reading package lists...
Building dependency tree...
Reading state information...
ENV :: HOSTNAME => 1e781dad89ba
ENV :: PWD => /
ENV :: HOME => /root
ENV :: SHLVL => 0
ENV :: PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

  • Restarting periodic command scheduler cron
  • Stopping periodic command scheduler cron
    ...done.
  • Starting periodic command scheduler cron
    ...done.
  • Restarting PHP 8.3 FastCGI Process Manager php-fpm8.3
    ...done.
  • Stopping MariaDB database server mariadbd
    ...done.
  • Starting MariaDB database server mariadbd
    ...fail!
  • Restarting nginx nginx
    ...done.
  • Restarting daemon monitor monit
    start-stop-daemon: warning: failed to kill 550: No such process
    ...done.
    ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.