version: "3.8"
services:
  nextapp:
    build: .
    deploy:
      update_config:
        parallelism: 1
        delay: 5s
        order: start-first
    container_name: logipedia
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.logipedia.rule=Host(`logipedia.shortman.me`)"
      - "traefik.http.routers.logipedia.entrypoints=websecure"
      - "traefik.http.services.logipedia.loadbalancer.server.port=3000"
      - "traefik.http.routers.logipedia.tls.certresolver=myresolver"
    expose:
      - "3000"
    # ports:
    #   - "3000:3000"
    networks:
      - webproxy
  db:
    image: postgres:latest
    container_name: logipedia-db
    restart: always
    shm_size: 128mb
    env_file:
      - .env
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"

volumes:
  pgdata:
    driver: local

networks:
  webproxy:
    external: true
