---
version: '3'

services:
  angestoepselt:
    image: codeberg.org/angestoepselt/homepage/angestoepselt:${BRANCH:-main}
    container_name: homepage-angestoepselt-${BRANCH:-main}
    restart: unless-stopped
    env_file: stack.env
    security_opt:
      - no-new-privileges:true
    labels:
      - 'traefik.enable=true'
      - 'traefik.docker.network=proxy'
      - 'traefik.http.routers.homepage-angestoepselt-${BRANCH:-main}-secure.rule=Host(`${ANGESTOEPSELT_DOMAIN}`,`www.${ANGESTOEPSELT_DOMAIN}`)'
      - 'traefik.http.routers.homepage-angestoepselt-${BRANCH:-main}-secure.entrypoints=websecure'
      - 'traefik.http.routers.homepage-angestoepselt-${BRANCH:-main}-secure.tls.certresolver=letsencrypt'
      - 'traefik.http.routers.homepage-angestoepselt-${BRANCH:-main}.middlewares=redirect-www-to-non-www@file'
    networks:
      - proxy

  coderdojo:
    image: codeberg.org/angestoepselt/homepage/coderdojo:${BRANCH:-main}
    container_name: homepage-coderdojo-${BRANCH:-main}
    restart: unless-stopped
    env_file: stack.env
    security_opt:
      - no-new-privileges:true
    labels:
      - 'traefik.enable=true'
      - 'traefik.docker.network=proxy'
      - 'traefik.http.routers.homepage-coderdojo-${BRANCH:-main}-secure.rule=Host(`${CODERDOJO_DOMAIN}`,`www.${CODERDOJO_DOMAIN}`)'
      - 'traefik.http.routers.homepage-coderdojo-${BRANCH:-main}-secure.entrypoints=websecure'
      - 'traefik.http.routers.homepage-coderdojo-${BRANCH:-main}-secure.tls.certresolver=letsencrypt'
      - 'traefik.http.routers.homepage-coderdojo-${BRANCH:-main}.middlewares=redirect-www-to-non-www@file'
    networks:
      - proxy

networks:
  proxy:
    external: true
