3

I'm trying to deploy a PHP Lumen webapp in heroku using docker containers.

I'm using docker-compose to deploy my app locally and there's no problem using it. I can test it in localhost without any issue.

This is my docker-compose file:

nginx:
  build: images/nginx
  command: nginx -g "daemon off;"
  links:
    - php
  ports:
    - "80:80"
php:
  build: images/php
  volumes:
    - ./images/php:/var/www/html
  working_dir: /var/www/html/app/public
  command: php-fpm
  links:
    - db
    - cache
  ports:
    - "9000:9000"
  environment:
    APP_ENV: local
    APP_DEBUG: 'true'
    APP_KEY: SomeRandomKey!!!
    APP_LOCALE: en
    APP_FALLBACK_LOCALE: en
    DB_CONNECTION: mysql
    DB_HOST: db
    DB_DATABASE: lumen
    DB_USERNAME: lumen
    DB_PASSWORD: secret
    MEMCACHED_HOST: cache
    CACHE_DRIVER: memcached
    CACHE_DRIVER: array
    SESSION_DRIVER: array
    QUEUE_DRIVER: array
    SESSION_DRIVER: cookie
db:
  image: mysql
  command: mysqld --default-authentication-plugin=mysql_native_password
  restart: always
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: secret
    MYSQL_DATABASE: lumen
    MYSQL_USER: lumen
    MYSQL_PASSWORD: secret
cache:
  image: memcached

I tried to deploy on heroku following its docu, doing this:

On root folder:
heroku create
heroku container:push web
heroku container:release web

Everything regarding deployment seems to be okay, but when I try to get into the application I get an error screen saying "Application error".

After taking a look to the logs, the only thing I can see is this message:

2019-04-15T21:54:41.459127+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=***.herokuapp.com request_id=**** fwd="***" dyno= connect= service= status=503 bytes= protocol=https
2019-04-15T21:54:42.185673+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=***.herokuapp.com request_id=**** fwd="***" dyno= connect= service= status=503 bytes= protocol

After doing some research I think it could be something related to the lack of database or soemthing like that but there's no point on debugging that "503" message so I don't know how to keep on solving.

Has anybody some idea of how can I solve this problem?

Any help would be appreciated. Thanks a lot.

lbarrous
  • 111
  • 7

0 Answers0