Skip to content

Running other applications on Lagoon#

Even if Lagoon doesn't have a base image for your particular application, framework or language, Lagoon can still build it!

Extending on, or inheriting from the commons image, Lagoon can run almost any workload.


This brief example shows how to build a Hugo website and serve it as static files in an nginx image. The commons image is used to add Hugo, copy the site in, and build it. The nginx image is then used to serve the site, with the addition of a customised nginx config.

nginx.dockerfile snippet
FROM uselagoon/commons as builder

RUN apk add hugo git
COPY . /app
RUN hugo

FROM uselagoon/nginx

COPY --from=builder /app/public/ /app
COPY lagoon/static-files.conf /etc/nginx/conf.d/app.conf

RUN fix-permissions /usr/local/openresty/nginx
docker-compose.yml snippet
      context: .
      dockerfile: lagoon/nginx.Dockerfile
      lagoon.type: nginx