I have written below dockerFile
FROM php:8.0-apache
WORKDIR /var/www/html
# Mod Rewrite
RUN a2enmod rewrite
# Linux Library
RUN apt-get update -y && apt-get install -y \
libicu-dev \
libmariadb-dev \
unzip zip \
zlib1g-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev
# Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# PHP Extension
RUN docker-php-ext-install gettext intl pdo_mysql gd
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
and in docker-compose file I have 3 services , laravel app, mysql and pgadmin
services:
inventory:
container_name: laravel-app
build: .
volumes:
- ./laravel-app:/var/www/html
ports:
- 9000:80
mysql_db:
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: invoice
volumes:
- ./DB/invoice.sql:/docker-entrypoint-initdb.d/invoice.sql
ports:
- 3306:3306
phpmyadmin:
image: phpmyadmin:latest
restart: always
ports:
- 9001:80
environment:
- PMA_ARBITRARY=1
After build in localhost:9000 I'm getting 403 Forbidden. But localhost:9000/public I'm getting laravel home page. How can I run this app in localhost:9000 rather then localhost:9000/public ?
http://localhost:9000/