Containerizing Xojo apps: cgi vs stand-alone?

For those of you who have already containerized Xojo apps for use in Docker, are you building for cgi or stand-alone?

Is anyone aware of a step-by-step primer or something similar to help people get started containerizing Xojo apps?

Containers can have either.

Nothing in production yet, but I’ve gone for stand-alone when running a Xojo built web app within a container as the extra overhead of a web server for cgi mode didn’t make much sense to me, as well as having the container naturally stop should the stand-alone server die seems like a good idea.

I gave an example of a Dockerfile at https://forum.xojo.com/42926-standalone-app-listening-on-multiple-ports/p1#p351071

I’ve been playing with Docker recently. I’ve dockerized cubeSQL, so that I can now use it easily on a Synology NAS. That has been pretty straight-forward (see the Dockerfile in the Description on Docker Hub).

Next attempt has been to run an Aloe Express Demo in a Docker Container.[quote=356328:@Seth Ober]Is anyone aware of a step-by-step primer or something similar to help people get started containerizing Xojo apps?[/quote]

  1. Build your Aloe Express Demo project for Target Linux 64Bit
  2. Create a Textfile named Dockerfile (content see below) in the built App’s directory
  3. In Terminal: cd /path/to/built-project
  4. docker build -t myname/myaloedemo:1.0.0 .
  5. This will build the Docker Image using the Dockerfile in this directory, and copy the Aloe Express Demo into it
  6. Create and run the container: docker run -d --publish=8080:8080 --name myaloedemotest myname/myaloedemo:1.0.0
  7. Try your Aloe Express app with a Browser

Dockerfile for the Aloe Express Example:

[code]#BASE IMAGE
FROM ubuntu:18.04

#INSTALL REQUIRED LIBRARIES
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y libunwind8 libglib2.0

#ADD APPLICATION TO DOCKER IMAGE
ADD / /app/

#EXPOSE PORT AND RUN APPLICATION
EXPOSE 8080
WORKDIR /app
CMD /app/aloe-express-demo
[/code]

Again: pretty straight forward.

Aloe Express (a Console Application) is probably quite the same as a Xojo Web App (Standalone). So I guess this kind of Dockerfile (using Ubuntu) should work for a Xojo Web App (Standalone), too. It might require some ssl Packages (should they not be part of the base image).