Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Spiral's avatar

How to dockerize php laravel application

Hi

Anybody can tell me that how to dockerize a php laravel application or you can provide a best plateform there i could learn and perform their task

0 likes
7 replies
cyber-kamil's avatar

I use something like this

FROM ubuntu:bionic

RUN apt-get -y update
RUN echo "Europe/London" > /etc/timezone
RUN apt-get -y install tzdata
RUN dpkg-reconfigure -f noninteractive tzdata
RUN apt-get install -y --allow-unauthenticated nginx-full
RUN apt-get install -y net-tools vim telnet software-properties-common git zip curl
RUN apt-add-repository -y ppa:ondrej/php
RUN apt -y update
RUN apt-get install -y php7.4-fpm php7.4-intl php7.4-curl php7.4-mbstring php7.4-mysql php7.4-xml php7.4-bcmath

WORKDIR /var/www

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY composer.lock .
COPY composer.json .
RUN composer install --no-scripts --no-autoloader --no-ansi --no-dev --no-interaction --no-progress

COPY . .

EXPOSE 8080
1 like

Please or to participate in this conversation.