I am new to Heroku. I am trying to deploy a docker container and although I have tried several options, it always crashes. On local in works fine, on port 8080.
Right now, I am using PHP + Apache.
My folder herarchy looks like this:
docker-compose.yml
Dockerfile
www
.htaccess
index.php
My Dockerfile is this one:
FROM php:7.1-apache
COPY www /var/www/html
RUN a2enmod rewrite
RUN a2enmod lbmethod_byrequests
RUN service apache2 restart
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
My docker-composer.yml:
version: '3'
services:
web:
build:
context: .
dockerfile: ./Dockerfile
image: myproject
ports:
- 8080:80
And the .htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
When I check the Heroku logs (heroku logs --tail), this is what I see:
Starting process with command `/usr/sbin/apache2ctl -D FOREGROUND`
State changed from starting to crashed
Process exited with status 1
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action '-D FOREGROUND' failed.
from Docker PHP + Apache deployment on Heroku crashes
No comments:
Post a Comment