Skip to content

This is a docker based laravel project deployment on GCP Cloud run

Notifications You must be signed in to change notification settings

HunaidV/stanky-laravel-run

Repository files navigation

Laravel LogoGCP Cloud run Logo

About this repository

You can use docker file and google cloud run to deploy the laravel application.

Laravel will be deployed on serverless Cloud Run using docker file and startup scripts.

Tutorial

  1. Run a local php server including all the dependencies for php version and composer.
  2. Add the Dockerfile to it.
FROM php:8.2-fpm-alpine #change the php version accordingly

RUN apk add --no-cache nginx supervisor wget #install other packages if require like pdo_psql

RUN mkdir -p /run/nginx #this creates a nginx folder

COPY docker/nginx.conf /etc/nginx/nginx.conf #it copies the nginx conf from docker folder as mentioned in repo.

RUN mkdir -p /app
COPY . /app 

#this install the composer dependencies
RUN sh -c "wget http://getcomposer.org/composer.phar && chmod a+x composer.phar && mv composer.phar /usr/local/bin/composer"
RUN cd /app && \
    /usr/local/bin/composer install --no-dev 

#if it gives platform errors try running with flaf --ignore-platform-reqs

RUN chown -R www-data: /app

CMD sh /app/docker/startup.sh

About

This is a docker based laravel project deployment on GCP Cloud run

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages