*alexandre* has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm currently ready to deploy my web application who have been written within CGI and have already deployed an hello world application into Google App Engine, but it use Mojolicious instead of my own Framework now I wanna know if it's possible to use CGI instead of Mojolicious. I want to run my application by accessing https://avant-garde-248215.appspot.com/cgi-bin/script.pl?lang=FR&page=main I've tryed to create a yaml file :
# Use the latest perl image from dockerhub FROM perl:latest # Install the web framework mojolicious RUN curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org - +n Mojolicious # Instruct mojolicious to listen on port 8080 and open the port ENV MOJO_LISTEN http://*:8080 EXPOSE 8080 # add your application code and set the working directory ADD . /app WORKDIR /app # change the permissions and run the application RUN chmod +x main.pl RUN chmod +x script.pl CMD ["./main.pl", "daemon"]
but not sure if I've to set : ADD . /app WORKDIR /app instead of cgi-bin thx

Replies are listed 'Best First'.
Re: Google App Engine and CGI
by Corion (Patriarch) on Jul 31, 2019 at 14:39 UTC

    Mojolicious apps can be started using the CGI protocol.

    Alternatively, you can rewrite your app to use CGI instead of Mojolicious.

    I'm not sure which one you actually want, but I assume it's the former. So you just have to instruct the webserver of GAE to launch the Mojolicious program as CGI and you should be done.

Re: Google App Engine and CGI
by Anonymous Monk on Jul 31, 2019 at 17:05 UTC
    CGI doesn't work like that. You'll have to add a CGI-capable web-server (Apache; ACME Labs mini_httpd/thttpd; anything else?) to your container image and set it up for your web app to work. Mojolicious and other Perl web frameworks, on the other hand, have an embedded web server in them.

        If you have Apache, all you need is to find out how to configure a CGI to run under Apache. Like maybe using mod_cgi?

A reply falls below the community's threshold of quality. You may see it by logging in.