Skip to content

12. Deployment

This chapter describes how to deploy a MontiGem application using Docker.

12.1 Requirements

Hardware (Recommended): * 2 CPUs * 4 GB RAM * 5 GB HDD

Software: * Linux OS with Docker Compose. * Open Ports 80 and 443 (TCP). * A Domain (for SSL via Let's Encrypt).

12.2 Building Docker Images

Backend

We recommend using Jib to build the backend image without a local Docker daemon.

cd backend
gradle jib \
      -Djib.to.image=<imageNameOfBackend> \
      -Djib.to.auth.username=<RegistryUser>  \
      -Djib.to.auth.password=<RegistryPassword>

Frontend

The frontend uses Caddy as a web server and reverse proxy.

  1. Ensure Dockerfile and Caddyfile are present (generated by setupFrontend).
  2. Build the image:
    cd frontend
    gradle assemble
    docker build . -t <imageNameOfFrontend>
    
  3. Push the image to your registry.

12.3 Deploying on Server

  1. Copy the docker-compose.yml (from docs/deploy/) to your server.
  2. Adjust the configuration (image names, ports).
  3. Login to your registry:
    docker login -u user -p <token> registry.example.com
    
  4. Start the application:
    docker compose up --detach
    

< Previous: Further Reading | Back to Index | Next: Testing >