What i`m missing during Docker usage

Hello everyone! I’m new to Docker and need to set up a web server on a machine within my network.

I want to access the server using the machine’s IP and the port served by Nginx (8080), followed by /EstagioUm.

The application was built with Laravel, so I installed and ran both NPM and Composer dependencies. However, when I try to access it from another machine using the IP, I get a 500 | Server Error.

For more info, i got an ubuntu

What could be causing this issue? What are the possible implications? Any thoughts? Thanks!!

My core file system goes like:

docker-compose.yml

version: ‘3’

networks:
laravel:

services:

nginx:
image: nginx:stable-alpine
container_name: nginx
ports:

  • “8080:80”
    volumes:
  • ./src/cobranca:/var/www/html/ #Pode Nao vincular o Publico. error case para ficar de olho
  • ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
  • php
  • mysql
    networks:
  • laravel

mysql:
image: mysql:8.4.3
container_name: mysql
restart: unless-stopped
tty: true
ports:

  • “3306:3306”
    volumes:
  • ./mysql:/var/lib/mysql
    environment:
    MYSQL_DATABASE: kanban
    MYSQL_USER: homestead
    MYSQL_PASSWORD: secret
    MYSQL_ROOT_PASSWORD: secret
    SERVICE_TAGS: dev
    SERVICE_NAME: mysql
    networks:
  • laravel

php:
build:
context: .
dockerfile: Dockerfile
container_name: php
volumes:

  • /var/www/html/vendor
  • ./src/cobranca:/var/www/html
    ports:
  • “9000:9000”
    networks:
  • laravel

Dockerfile

FROM php:8.4-fpm-alpine

RUN apk add --no-cache
zlib-dev
libpng-dev
libjpeg-turbo-dev
freetype-dev
libwebp-dev
libzip-dev
oniguruma-dev
bash
git
zip
unzip
nano

RUN docker-php-ext-configure gd
–with-freetype
–with-jpeg
–with-webp

RUN docker-php-ext-install
pdo_mysql
gd
zip
mbstring
exif
pcntl

ENV COMPOSER_ALLOW_SUPERUSER=1

COPY --from=composer:2.4 /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

COPY ./src/cobranca ./

RUN composer install --no-dev --optimize-autoloader


Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
services:
  service1:
    image: image1
```

After fixing your post, please send a new comment so people are notified about the fixed content.


HTTP 500 is a web server error code which means you should be able to get more detailed logs from that server to figure out what the problem is.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.