Git Product home page Git Product logo

php-laravel-docker's Introduction

Laravel 11 with a Docker PHP Image

A demo repo for deploying a Laravel PHP application on Render using Docker. You can follow the getting started tutorial here.

Deployment

  1. Create a new PostgreSQL database on Render and copy the internal DB URL to use below.

  2. Fork this repo to your own GitHub account.

  3. Create a new Web Service on Render, and give Render's GitHub app permission to access your new repo.

  4. Select Docker for the environment, and add the following environment variable under the Advanced section:

    Key Value
    APP_KEY Copy the output of php artisan key:generate --show
    DATABASE_URL The internal database url for the database you created above.
    DB_CONNECTION pgsql

That's it! Your Laravel 11 app will be live on your Render URL as soon as the build finishes. You can test it out by registering and logging in.

php-laravel-docker's People

Contributors

aduong avatar anurag avatar connor11528 avatar dependabot[bot] avatar jess-render avatar paulprins avatar wendorf avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

php-laravel-docker's Issues

Problem with CMD start.sh

FROM richarvey/nginx-php-fpm:2.0.4

COPY . .

ENV SKIP_COMPOSER 1
ENV WEBROOT /var/www/html/public
ENV PHP_ERRORS_STDERR 1
ENV RUN_SCRIPTS 1
ENV REAL_IP_HEADER 1

ENV APP_ENV production
ENV APP_DEBUG false
ENV LOG_CHANNEL stderr

ENV COMPOSER_ALLOW_SUPERUSER 1


CMD ["chmod +rx /start.sh ","/start.sh"]

I have this content in my Dockerfil. But i have an error with CMD ["chmod +rx /start.sh ","/start.sh"] , The start.sh file not found.

In my project, the file if exsits. The content is:

#!/usr/bin/bash
echo "Running composer"
composer global require hirak/prestissimo
composer install --no-dev --working-dir=/var/www/html

echo "Caching config..."
php artisan config:cache

echo "Caching routes..."
php artisan route:cache

echo "Running app"
php artisan serve --host 0.0.0.0 --port 10000

Please update the about me

Made me almost not want to try it out! But yeah, looks like you're right up to L11, and I appreciate that.

image

Example of triggering jobs on cron schedule?

Hi there, we have a schedule set to run a job on a regular basis but it doesn't seem this job is running. We've added this to the schedule function within app/Console/Kernel.php as outlined in the Laravel task scheduling docs.

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function() {
            (new JobListingsSeeder)->run();
        })->weekly()->sundays()->at('18:00');
        Artisan::call('cache:clear');

        $schedule->command('populateCompanyRaiseRounds')->twiceDaily(1, 13);
    }

However it doesn't appear that these commands are running. I see that there are Render docs on cron jobs. I was wondering, how can we run Artisan commands on a schedule while hosted on Render?

Example .env file?

Hi there, I am looking to modify our existing Laravel app to use Postgres and be deployed on Render. Do we have an example .env file that we could include in .env.example? Getting some connection errors and I think having an example .env file would help :)

How to install Node and NPM packages with Vite

I am running Laravel 10 application. Everything is working I guess but I have an error "Vite manifest file is not found".
How do I install node and npm, and run npm scripts?

Thank you in advance.

Laravel 11: DB_URL instead of DATABASE_URL

### Description:

When deploying a Laravel 11 application on (render.com), I encountered an issue with the database connection. The DATABASE_URL environment variable, which was previously used in earlier Laravel versions, has been replaced with DB_URL in Laravel 11.

To resolve this, update your (render.com) environment variables to use DB_URL instead of DATABASE_URL. This change will allow your Laravel 11 application to connect to the database successfully.

### Steps to reproduce:

  1. Deploy a Laravel 11 application on (render.com)
  2. Set the DATABASE_URL environment variable
  3. Run database migrations or try to access the database

### Expected behavior:

The application should connect to the database using the DB_URL environment variable.

### Actual behavior:

The application fails to connect to the database, throwing a Connection refused error.

### Solution:

Update the environment variable to DB_URL and redeploy your application.

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.