Level 70
@shaher11 Is your container running? Have you checked the details in the container log?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I created a laravel docker app with Nginx and Postgres, after building and running the app it worked fine on Windows but not worked on Ubuntu.
The error page:
This page isn’t working
localhost didn’t send any data.
ERR_EMPTY_RESPONSE
docker-compose.yml
version: '3'
networks:
webapp:
services:
nginx:
image: nginx:stable-alpine
container_name: ${APP_NAME}_nginx
ports:
- "8080:80"
links:
- php
volumes:
- ./:/var/www/html
- ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf:rw
- ./docker/logs/nginx:/var/logs/nginx:rw
depends_on:
- php
- postgres
networks:
- webapp
php:
build:
context: .
dockerfile: Dockerfile
container_name: ${APP_NAME}_php
volumes:
- ./:/var/www/html
ports:
- "9001:9000"
networks:
- webapp
postgres:
image: postgres:12.3-alpine
container_name: ${APP_NAME}_postgres
restart: unless-stopped
ports:
- "5433:5432"
volumes:
- ./docker/postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_HOST_AUTH_METHOD: "trust"
networks:
- webapp
Dockerfile
FROM php:8.0-fpm-alpine
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN set -ex \
&& apk --no-cache add postgresql-dev nodejs yarn npm\
&& docker-php-ext-install pdo pdo_pgsql
WORKDIR /var/www/html
Please or to participate in this conversation.