name: myapp
networks:
  proxy:
    name: proxy
    external: true
#  joplinsrv:
#    name: joplinsrv
#    driver: bridge
# This is a sample docker-compose file that can be used to run Joplin Server
# along with a PostgreSQL server.
#
# Update the following fields in the stanza below:
#
# POSTGRES_USER
# POSTGRES_PASSWORD
# APP_BASE_URL
#
# APP_BASE_URL: This is the base public URL where the service will be running.
#	- If Joplin Server needs to be accessible over the internet, configure APP_BASE_URL as follows: https://example.com/joplin. 
#	- If Joplin Server does not need to be accessible over the internet, set the APP_BASE_URL to your server's hostname. 
#     For Example: http://[hostname]:22300. The base URL can include the port.
# APP_PORT: The local port on which the Docker container will listen. 
#	- This would typically be mapped to port to 443 (TLS) with a reverse proxy.
#	- If Joplin Server does not need to be accessible over the internet, the port can be mapped to 22300.

services:
#    db:
#        image: postgres:16
#        volumes:
#            - ./data/postgres:/var/lib/postgresql/data
#        ports:
#            - "5432:5432"
#        restart: unless-stopped
#        environment:
#            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
#            - POSTGRES_USER=${POSTGRES_USER}
#            - POSTGRES_DB=${POSTGRES_DATABASE}
    app:
        container_name: joplinsrv
        image: joplin/server:latest
#        depends_on:
#            - db
#        ports:
#            - "22300:22300"
        restart: unless-stopped
        environment:
            - APP_PORT=22300
            #- APP_BASE_URL=http://10.0.6.177:22300
            - APP_BASE_URL=https://joplin.lab.gurulandia.eu
            - DB_CLIENT=pg
            - POSTGRES_PASSWORD=joplinsrv
            - POSTGRES_DATABASE=joplin
            - POSTGRES_USER=joplinsrv
            - POSTGRES_PORT=5432
            - POSTGRES_HOST=10.0.6.178
            #- STORAGE_DRIVER=Type=S3; Region=us-east-1; Path=http://192.168.55.30:53008; AccessKeyId=joplinsrv; SecretAccessKeyId=joplinsrv; Bucket=joplin
            - MAILER_ENABLED=1
            - MAILER_HOST=mailrise.lab.gurulandia.eu
            - MAILER_PORT=465
            - MAILER_SECURITY=tls
            - MAILER_AUTH_USER=gurulandia
            - MAILER_AUTH_PASSWORD=gurulandia
            - MAILER_NOREPLY_NAME=JoplinServer
            - MAILER_NOREPLY_EMAIL=my_email_address
        networks:
            - proxy
        labels:
            traefik.enable: true
            ## HTTP Routers
            traefik.http.routers.joplin-server-rtr.entrypoints: https
            traefik.http.routers.joplin-server-rtr.rule: Host(`joplin.lab.gurulandia.eu`)
            ## Middlewares
            #- "traefik.http.routers.${GOTIFY_HOST_NAME}-rtr.middlewares=chain-authelia@file"
            traefik.http.routers.joplinserver-rtr.middlewares: chain-no-auth@file
            ## HTTP Services
            traefik.http.routers.joplin-server-rtr.service: joplin-server-svc
            traefik.http.services.joplin-server-svc.loadbalancer.server.port: 22300

 #       dns_search:
 #           - dc1.example.com
 #           - dc2.example.com
            
 #       hostname:

#
#        one:
#            label_file: ./app.labels
#
#        two:
#            label_file:
#            - ./app.labels
#            - ./additional.labels

#        dns: 8.8.8.8

#        dns:
#        - 8.8.8.8
#        - 9.9.9.9
#        domainname:
  
#  test_lib:
#    image: test_lib_image
#    profiles:
#      - test

#  coverage_lib:
#    image: coverage_lib_image
#    depends_on:
#      - test_lib
#    profiles:
#      - test

#  debug_lib:
#    image: debug_lib_image
#    depends_on:
#      - test_lib
#    profiles:
#      - debug
#include:
#  - my-compose-include.yaml  #with serviceB declared
#services:
#  serviceA:
#    build: .
#    depends_on:
#      - serviceB #use serviceB directly as if it was declared in this Compose file

#x-custom:
#  foo:
#    - bar
#    - zot

#networks:
#  network1:
#    external: true
#    name: "${NETWORK_ID}"

#     depends_on:
#      - crowdsec

#include:
#  - my-compose-include.yaml  #with serviceB declared
#services:
#  serviceA:
#    build: .
#    depends_on:
#      - serviceB #use serviceB directly as if it was declared in this Compose file