This is a simple guide to running mojolicious on Google App Engine.
-
Create an
app.yaml
in the root of your application with the following contents:runtime: custom vm: true api_version: 1
-
Create a
Dockerfile
in the root of your application with the following contents:FROM perl:latest RUN curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious ENV MOJO_LISTEN http://*:8080 ADD . /app EXPOSE 8080 WORKDIR /app RUN chmod +x main.pl CMD ["./main.pl", "daemon"]
-
Create a project in the Google Developers Console.
-
Make sure you have the Google Cloud SDK installed.
$ curl https://sdk.cloud.google.com | bash $ gcloud init $ gcloud components update app
-
Deploy your app:
gcloud preview app deploy app.yaml --set-default --project [your-project-id]
You are now running perl on App Engine. How cool is that? Check it out at https://mojolicious-demo.appspot.com/.