Open troykelly opened 8 hours ago
The Traefik Instructions don't mention that bypassing the caddy service in the container prevents access to /uploads
A ~fix~ hack for this is:
labels:
- traefik.enable=true
- traefik.docker.network=proxy
- traefik.constraint-label=traefik-public
#----------------------------------------------- routers for: postiz --------------------------------------------------
# HTTP router
- traefik.http.routers.postiz-${SITE}-http.rule=Host(`${SITE_DOMAIN}`)
- traefik.http.routers.postiz-${SITE}-http.entrypoints=http
- traefik.http.routers.postiz-${SITE}-http.middlewares=servicests,block-apple,https-redirect,reporturi
- traefik.http.routers.postiz-${SITE}-http.service=noop@internal
# HTTPS router for uploads
- traefik.http.routers.postiz-uploads-${SITE}-https.rule=Host(`${SITE_DOMAIN}`) && PathPrefix(`/uploads/`)
- traefik.http.routers.postiz-uploads-${SITE}-https.entrypoints=http3
- traefik.http.routers.postiz-uploads-${SITE}-https.service=postiz-uploads-${SITE}
- traefik.http.routers.postiz-uploads-${SITE}-https.tls.certresolver=${SITE_RESOLVER}
- traefik.http.routers.postiz-uploads-${SITE}-https.middlewares=gzip,limit,reporturi,block-apple
- traefik.http.routers.postiz-uploads-${SITE}-https.priority=20
# HTTPS router for frontend
- traefik.http.routers.postiz-${SITE}-https.rule=Host(`${SITE_DOMAIN}`) && !PathPrefix(`/uploads/`)
- traefik.http.routers.postiz-${SITE}-https.entrypoints=http3
- traefik.http.routers.postiz-${SITE}-https.service=postiz-${SITE}
- traefik.http.routers.postiz-${SITE}-https.tls.certresolver=${SITE_RESOLVER}
- traefik.http.routers.postiz-${SITE}-https.middlewares=gzip,limit,reporturi,block-apple
- traefik.http.routers.postiz-${SITE}-https.priority=10
# HTTPS API router
- traefik.http.routers.postiz-api-${SITE}-https.rule=Host(`api.${SITE_DOMAIN}`)
- traefik.http.routers.postiz-api-${SITE}-https.entrypoints=http3
- traefik.http.routers.postiz-api-${SITE}-https.service=postiz-api-${SITE}
- traefik.http.routers.postiz-api-${SITE}-https.tls.certresolver=${SITE_RESOLVER}
- traefik.http.routers.postiz-api-${SITE}-https.middlewares=cors-headers-${SITE},gzip,limit,reporturi,block-apple
#----------------------------------------------- CORS Middleware --------------------------------------------------
# Define CORS headers middleware
- traefik.http.middlewares.cors-headers-${SITE}.headers.accessControlAllowOriginList=https://${SITE_DOMAIN}
- traefik.http.middlewares.cors-headers-${SITE}.headers.accessControlAllowMethods=GET,OPTIONS,PUT,POST,DELETE
- traefik.http.middlewares.cors-headers-${SITE}.headers.accessControlAllowHeaders=Origin,Content-Type,Accept,Authorization
- traefik.http.middlewares.cors-headers-${SITE}.headers.accessControlAllowCredentials=true
- traefik.http.middlewares.cors-headers-${SITE}.headers.addVaryHeader=true
#====================================================== services ===========================================================
- traefik.http.services.postiz-${SITE}.loadbalancer.server.port=4200
- traefik.http.services.postiz-api-${SITE}.loadbalancer.server.port=3000
- traefik.http.services.postiz-uploads-${SITE}.loadbalancer.server.port=5000
đ Description
When trying to use postiz in a compose hosted environment - all images return 404. I've tried setting the environment variable
NEXT_PUBLIC_UPLOAD_DIRECTORY
per https://docs.postiz.com/installation/docker-compose I've tried setting the environment variableNEXT_PUBLIC_UPLOAD_STATIC_DIRECTORY
per https://github.com/gitroomhq/postiz-app/blob/main/.env.exampleDoes not work
Does not work
đ Reproduction steps
đ Expected behavior
It should work
đ Actual Behavior with Screenshots
Container Log
Files are there
đť Operating system
Linux
đ¤ Node Version
v20.17.0
đ Provide any additional context for the Bug.
Compose
đ Have you spent some time to check if this bug has been raised before?
Are you willing to submit PR?
Yes I am willing to submit a PR!