Deploying LAMP stack without traefik

Hello,

Currently I have this lamp.yml file deployed with traefik.

version: '3.7'
services:
  server:
    image: bidmcdigitalpsychiatry/lamp-server:2020
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
    environment:
      HTTPS: 'off'
      ROOT_KEY: 'fd804de0e9fb5bec33e888ad27c0ede41d39ff8e520c8a38fd8515618064ce24'
      CDB: 'http://admin:password@database:5984/'
      PUSH_API_GATEWAY: 'https://app-gateway.lamp.digital/'
      PUSH_API_KEY: '<PUSH_API_KEY>'
      DASHBOARD_URL: 'dashboard.lamp.digital'
      REDIS_HOST: 'redis://cache:6379/0'
      NATS_SERVER: 'message_queue:4222'
    networks:
      - public
    deploy:
      mode: replicated
      update_config:
        order: start-first
        failure_action: rollback
      labels:
         traefik.enable: 'true'
         traefik.http.routers.lamp_server.entryPoints: 'websecure'
         traefik.http.routers.lamp_server.rule: 'Host(`romlptestapi`)'
         traefik.http.routers.lamp_server.tls.certresolver: 'default'
         traefik.http.services.lamp_server.loadbalancer.server.port: 3000
      placement:
        constraints:
          - node.role == manager
  database:
    image: mlpcouchdb
    healthcheck:
      test: curl --fail --silent http://localhost:5984/_up || exit 1
    environment:
      COUCHDB_USER: 'admin'
      COUCHDB_PASSWORD: 'password'
    volumes:
      - /apps/mindLAMP/data/couchdb:/opt/couchdb/data
    networks:
      - public
    deploy:
      mode: replicated
      update_config:
        order: stop-first
        failure_action: rollback
      placement:
        constraints:
          - node.role == manager
    labels:
      traefik.enable: 'true'
      traefik.http.routers.lamp_database.entryPoints: 'websecure'
      traefik.http.routers.lamp_database.rule: 'Host(`romlptestdb`)'
      traefik.http.routers.lamp_database.tls.certresolver: 'default'
      traefik.http.services.lamp_database.loadbalancer.server.port: 5984
  cache:
    image: redis:6.0.8-alpine
    healthcheck:
      test: redis-cli ping
    deploy:
      mode: replicated
      update_config:
        order: stop-first
        failure_action: rollback
      placement:
        constraints:
          - node.role == manager
  message_queue:
    image: nats:2.1.9-alpine3.12
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:8222/varz || exit 1
    deploy:
      mode: replicated
      update_config:
        order: start-first
        failure_action: rollback
      placement:
        constraints:
          - node.role == manager
networks:
  public:
    external: true

If I do NOT want to use traefik, how does the lamp.yml will look like and how should I refer the LAMP API SERVER domain in Dashboard - https://dashboard.lamp.digital ?

Thanks for your help!

If you don’t require Traefik, you can remove the labels section of the docker-compose.yml file. The server address you’d use must be a domain that points to your HTTPS (port 443) server.

Thanks Aditya, do we need to mention any ports in the yml file for LAMP API Server?

Nope - as long as port 443 is accessible to your load balancer of choice (i.e. Traefik or otherwise).

OK Thanks Aditya!

1 Like