6 months ago
i have a php project with this dockerfile
FROM php:8.2-apache
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN apt-get update && apt-get install -y zip git unzip
COPY php.ini /usr/local/etc/php/php.ini-production
COPY php.ini /usr/local/etc/php/php.ini-development
WORKDIR /var/www/html
COPY app/ ./
RUN composer install
RUN a2enmod rewrite
RUN docker-php-ext-install pdo pdo_mysql
EXPOSE 80
when I deploy it at railway the autoload dosent work, and I dont know why, but when I run it using docker compose file it works perfectly
services:
server_http:
build: ./
ports:
- 8080:80
volumes:
- ./app/:/var/www/html
env_file:
- .env
networks:
- app_network
db_mysql:
image: mysql
ports:
- 3307:3306
env_file:
- .env
volumes:
- ./datadir/mysql:/var/lib/mysql
networks:
- app_network
networks:
app_network:
driver: bridge
I dont know if the problem is my dockerfile or my composer.json just help me
my composer.json file
{
"name": "eventnow/app",
"type": "project",
"license": "MIT",
"autoload": {
"psr-4": {
"Eventnow\\App\\": "src/"
}
},
"authors": [
{
"name": "Alysson-Chrysthian",
"email": "Alyssonchrysthian@gmail.com"
}
],
"minimum-stability": "stable",
"require": {
"firebase/php-jwt": "^6.10"
}
}
0 Replies