qdm12 / stackedit-docker

StackEdit 5.14.5 Server in a light Docker container
https://hub.docker.com/r/qmcgaw/stackedit
MIT License
42 stars 16 forks source link

Doesn't work with traefik #3

Closed SckyzO closed 4 years ago

SckyzO commented 5 years ago

Hi qdm12,

I try to run this container with my traefik proxy, but i have already an error : 404 not found. Work perfectly with nodeport open, but not with traefik proxy.

Of course my traefik working fine, and i have 20 apps working with traefik

This is my docker-compose.yml :

version: '3'
services:

#############
# STACKEDIT #
#############
  stackedit:
    image: qmcgaw/stackedit
    container_name: stackedit
    restart: unless-stopped
    networks:
      - traefik_proxy
    ports:
      - 8000:8000
    labels:
      - "traefik.enable=true"
      - "traefik.backend=stackedit"
      - "traefik.frontend.rule=Host:stackedit.${DOMAINNAME}"
      - "traefik.port=8000"
      - "traefik.docker.network=traefik_proxy"
      - "traefik.frontend.headers.SSLRedirect=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.browserXSSFilter=true"
      - "traefik.frontend.headers.contentTypeNosniff=true"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.SSLHost=${DOMAINNAME}"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
      - "traefik.frontend.headers.frameDeny=true"

###########
# NETWORK #
###########
networks:
  traefik_proxy:
    external:
      name: traefik_proxy
  default:
    driver: bridge

If you can help me :)

Regard,

qdm12 commented 5 years ago

I have no experience with Traefik proxy although I am using Caddy which may be similar. Maybe try just exposing the port 8000 of stackedit in the traefik_proxy and have traefik proxies to stackedit:8000 ? I don't really know what the labels are for though.

version: '3'
services:
  stackedit:
    image: qmcgaw/stackedit
    container_name: stackedit
    restart: unless-stopped
    networks:
      - traefik_proxy
    expose:
      - 8000/tcp
    labels:
      - "traefik.enable=true"
      - "traefik.backend=stackedit"
      - "traefik.frontend.rule=Host:stackedit.${DOMAINNAME}"
      - "traefik.port=8000"
      - "traefik.docker.network=traefik_proxy"
      - "traefik.frontend.headers.SSLRedirect=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.browserXSSFilter=true"
      - "traefik.frontend.headers.contentTypeNosniff=true"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.SSLHost=${DOMAINNAME}"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
      - "traefik.frontend.headers.frameDeny=true"

networks:
  traefik_proxy:
    external: true
SckyzO commented 5 years ago

Too bad, Traefik is a very good reverse proxy :) easy to use :) But with lot of stackedit image i have this problem ... I think stackedit doesn't support proxy :) Of course if I use IP_ADDRESS:8000 or domain_name:8000 it's work but I would like to use it with traefik.

Do not close this ticket since 2/3 weeks, i will investigate and if you don't have informations about me you can close it.

I prefer access to my web applications without port in my URL. For information labels is just for SSL redirect content, but with this or not i can't access with clean url.

Regard,

qdm12 commented 4 years ago

Hi there,

I have added the ROOT_URL env variable, maybe that can help? It's untested though, so not 100% certain it works 😆

Did you have any chance with Traefik?

moookino commented 4 years ago

Hi, im using traefik v2.0 and this works for me

version: "3.7"
     services:
       stackedit:
         image: qmcgaw/stackedit
         container_name: stackedit
         environment:
          - LISTENING_PORT=8000
          - ROOT_URL=/
          - USER_BUCKET_NAME=stackedit-users
          - PAYPAL_RECEIVER_EMAIL=
          - DROPBOX_APP_KEY=
          - DROPBOX_APP_KEY_FULL=
          - GITHUB_CLIENT_ID=
          - GITHUB_CLIENT_SECRET=
          - GOOGLE_CLIENT_ID=
          - GOOGLE_API_KEY=_
          - WORDPRESS_CLIENT_ID=
        networks:
          - proxy
        restart: always
        labels:
          - "traefik.enable=true"
          - "traefik.http.routers.stackedit.entrypoints=http"
          - "traefik.http.routers.stackedit.rule=Host(`stackedit.example.com`)"
          - "traefik.http.middlewares.stackedit-https-redirect.redirectscheme.scheme=https"
          - "traefik.http.routers.stackedit.middlewares=stackedit-https-redirect"
          - "traefik.http.routers.stackedit-secure.entrypoints=https"
          - "traefik.http.routers.stackedit-secure.rule=Host(`stackedit.example.com`)"
          - "traefik.http.routers.stackedit-secure.tls=true"
          - "traefik.http.routers.stackedit-secure.tls.certresolver=http"
          - "traefik.http.routers.stackedit-secure.service=stackedit"
          - "traefik.http.services.stackedit.loadbalancer.server.port=8000"
          - "traefik.docker.network=proxy"

    networks:
      proxy:
        external: true
qdm12 commented 4 years ago

Thanks for sharing! I'll close the issue for now, feel free to re-open it.