Giter VIP home page Giter VIP logo

Comments (5)

lorisleiva avatar lorisleiva commented on July 20, 2024 3

Hi there 👋

To be honest, I originally created this image for continuous integration tools so I never really needed FPM but I'm willing to consider using it as a new set of images.

My primary goal for this image is to stay as small as possible whilst covering the 80% use cases of Laravel users. FPM being a pretty important part of PHP, I think you make a good point.

Could I ask you why you need FPM in your case? Are you using this image in a production server?

@fgilio Franco, do you have any strong opinion on this?

from laravel-docker.

fgilio avatar fgilio commented on July 20, 2024 1

Hmmm I don't really have a lot of experience in this front. One thing that comes to mind if that using an FPM enabled version of the PHP image would be all that's required.
Sorry I can't be of more help, I'll be following the discussion closely.

from laravel-docker.

polarathene avatar polarathene commented on July 20, 2024

Are you using this image in a production server?

Just recently added it to a server due to a request from a PHP dev for a Laravel setup, it's not serving a production site or service at present. Other PHP based containers I have been using are all this trafex/alpine-nginx-php7 image, which also bundled nginx as their webservers, which are used in combination with nginx-proxy.

In future, I plan to migrate the reverse-proxy to Traefik, and not being too familiar with PHP environments myself(this is a non-profit community rather than commercial). I've only recently been aware that nginx can be separated out to it's own container while using the fpm related part of nginx config.

When I set these PHP containers up for their community a couple years back, I recall FPM being important / helpful improvement, it has about 1,000 active users, not that big, but not too small either. Most guides for using nginx with PHP mention with FPM afaik, so it may have been related to that as well.

Presently the container is setup like so with docker-compose(I know that artisan is not meant to be used for production, and will switch it when I've had time to figure out how):

  laravel:
    image: lorisleiva/laravel-docker:7.3
    container_name: test_laravel
    restart: always
    ports:
      - 8000:8000
    links:
      - db
    environment:
      VIRTUAL_PORT: 8000
      VIRTUAL_HOST: laravel.example.tld
      LETSENCRYPT_HOST: laravel.example.tld
      LETSENCRYPT_EMAIL: ${ADMIN_EMAIL}
    volumes:
      - ./websites/laravel/hello_world:/var/www/laravel
    working_dir: /var/www/laravel/
    command: php artisan serve --port=8000 --host=0.0.0.0

The host param for artisan needed to be 0.0.0.0(listen on all interfaces, not just loopback/localhost of the container), otherwise the docker host would get connection failures when making a request to the container despite the port mapping.

The working_dir, was because of the default one has an "html" directory and I'm mounting the laravel project(I could have gone with anything else like /srv/laravel too I guess). I'm not sure if the "html" dir mattered or not when mounting a volume, but wanted to avoid dealing with any potential surprises later.

I originally created this image for continuous integration tools

There doesn't appear to be any official Laravel images on DockerHub and yours seemed to be a reasonably popular and still maintained image, after evaluating several others out there I decided yours was most appropriate for getting something up and going with minimal fuss.

Your CI with GitLab Pipelines article also helped influence the choice as I'd like to go over that to get some automated deployments going. Presently any docker related changes are manually managed on the server with docker-compose commands, while project code is managed with git(and GitLab), it's sync'd to the project folders by the devs when they have production updates.

from laravel-docker.

8ctopus avatar 8ctopus commented on July 20, 2024

I was facing the same limitation with Loris' docker image so I created another docker image which adds apache and php-fpm. if interested you can check it out here https://github.com/8ctopus/apache-php-fpm-alpine.

from laravel-docker.

sean7218 avatar sean7218 commented on July 20, 2024

can i use this image for production on AWS with artisan serve?

from laravel-docker.

Related Issues (20)

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.