First working public deployment on public server using docker-compose and docker registry.

Used files and commands to deploy on server:

Fixed error for elasticsearch:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

with

sudo sysctl -w vm.max_map_count=262144

docker-compose.yml

version: '3'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1
    ##    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - elasticsearchdata:/usr/share/elasticsearch/data
        #    networks:
            #      - elasticsearch
#    ports:
#      - 9200:9200
  postgres:
    image: postgres
    restart: unless-stopped
    volumes:
      - postgresqldata:/var/lib/postgresql/data
    environment:
      - 'POSTGRES_USER=postgres'
      # CHANGE THE PASSWORD!
      - 'POSTGRES_PASSWORD=postgres'
      - 'POSTGRES_DB=notes'
      - 'POSTGRES_ENCODING=UNICODE'
      - 'POSTGRES_COLLATE=C'
      - 'POSTGRES_COLLATE_TYPE=C'
  notes:
    image: docker-registry.kumbeiz.de/kumbeiz/notes
    restart: unless-stopped
    volumes:
      - notesdata:/usr/share/notes/data
        #   networks:
  #    - elasticsearch
    ports:
      - 8010:80
    depends_on:
      - postgres
      - elasticsearch

volumes:
  elasticsearchdata:
    external: false
  postgresqldata:
    external: false
  notesdata:
    external: false

    #networks:
    #  elasticsearch:

/etc/nginx/sites-available/notes.alexander.kumbeiz.de

upstream notes {
        server 173.249.31.122:8010;
}

server {
        server_name  notes.alexander.kumbeiz.de;

        location / {
                #proxy_set_header  Host $host;
                proxy_set_header  X-Real-IP $remote_addr;
                #proxy_set_header  X-Forwarded-Proto https;
                proxy_set_header  X-Forwarded-For $remote_addr;
                #proxy_set_header  X-Forwarded-Host $remote_addr;
                proxy_pass  http://notes;
        }

    listen 443 ssl; # managed by Certbot

    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


    ssl_certificate /etc/letsencrypt/live/notes.alexander.kumbeiz.de/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/notes.alexander.kumbeiz.de/privkey.pem; # managed by Certbot
}

server {
    if ($host = notes.alexander.kumbeiz.de) {
        return 302 https://$host$request_uri;
    } # managed by Certbot


        listen 80;
        listen [::]:80;

        server_name notes.alexander.kumbeiz.de;
    return 404; # managed by Certbot
}