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