Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include PhP #15

Open
rsnbusa opened this issue Aug 17, 2021 · 3 comments
Open

How to include PhP #15

rsnbusa opened this issue Aug 17, 2021 · 3 comments

Comments

@rsnbusa
Copy link

rsnbusa commented Aug 17, 2021

Hi.

I have a dockerfile and docker-compose.yml file that starts an Apache-PHP-Node environment which has been tested to satisfaction.

The dockerfile is

FROM php:8.0-apache
COPY . /var/www/html
RUN docker-php-ext-install pdo pdo_mysql mysqli.  //need to access pdo apis
EXPOSE 80

The docker-compose file is

version: '3'


services:
    web-service:
        build: ./flowiot
        volumes: 
            - ./flowiot:/var/www/html
            - ./settings:/var/rsn
        ports:
            - 80:80
            - 443:443
    node-service:
        build: ./app
        volumes:
            - ./settings:/tmp/rsn
            - 

As you can see a Webserver is launched as well as a node app. And both apps are up and performing as expected.

When using your dockerfile, in the same directory using the original webserver dir (plus adding the Config folder) it does complete the installation and states that the webserver and node app are running.

Creating root_node-service_1 ... done
Creating root_web-service_1  ... done

The node app is working per usual and the webserver serves the html index page Ok. Since there is no PHP, it fails to perform its PHP duties. Also there is no ssl lock in the Browser.

Reviewing the webserver container via exec and looking at the etc/apache2/sites-available there is no WebServer Domain (flowiot.site) as set in the dockerfile ENV DOMAINS="flowiot.site".

ENV DEBIAN_FRONTEND noninteractive
ENV LETSENCRYPT_HOME /etc/letsencrypt
ENV DOMAINS "flowiot.site"
ENV WEBMASTER_MAIL "rsimpso........"

My questions are:
1._ Did I miss something that I did not get a SSL from LetsEncrypt
1._ How do I add PHP. I did try adding a FROM php:7.4 which HAS to be the first statement or your process exit with an error about the website directory. IF done first it does finish but no PHK (did exec to the webserver and did a php -v).

Thanks for any help. As u can imagine, Apache-PHP go very hand in hand for many older services.

Regards.

Robert

@rsnbusa
Copy link
Author

rsnbusa commented Aug 17, 2021

Sorry forgot to state that there is no etc/letsencrypt directory

@BirgerK
Copy link
Owner

BirgerK commented Aug 18, 2021

Hi,
This is just a simple web-server for static content. No PHP.

Ofc one could expand my existing dockerfile and install just the apache-php-packages like described in one of the many tutorials: https://www.serverlab.ca/tutorials/linux/web-servers-linux/installing-php-for-apache-on-ubuntu/

But I won't do that, because I'm not spending time anymore on this project, sorry!

Did I miss something that I did not get a SSL from LetsEncrypt

Like said in the readme, ofc you need a configured VirtualHost, which uses that domain. Else Letsencrypt won't give you an y certs.

@rsnbusa
Copy link
Author

rsnbusa commented Aug 18, 2021

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants