devforth/spa-to-http

Problem enabling brotli compression when working with remote Docker image

ingesa-mel opened this issue · 2 comments

Hey guys,

your tool really improves my workflow so thank you for that!

However, I have the following issue with enabeling brotli compression:

  • My Vue.js SPA is on Docker Hub
  • I run it with docker compose from a different repository

I follow the below instruction to enable brotli. Due to my setup I don't have a build tag.

trfk-vue:
build: "spa" # name of the folder where Dockerfile is located
command: --brotli --threshold 500
labels:
- "traefik.enable=true"
- "traefik.http.routers.trfk-vue.rule=Host(trfk-vue.localhost)"
- "traefik.http.services.trfk-vue.loadbalancer.server.port=8080"

But I get the following error from my SPA container:

container exited with code 2
container | panic: lstat proc/1/fd/9: no such file or directory
container | goroutine 6 [running]:
container | go-http-server/app.(*App).CompressFiles(0x0?)
container | /code/app/app.go:103 +0x73
container | created by main.main.func1
container | /code/main.go:19 +0xba

Is this caused by my setup with the image from docker hub?

As a workaround I tried to add the brotli command in my Dockerfile directly, but with no luck.

Thank you for any pointers.

Hey, thanks for reminder in contact form. We are not actively maintain it, but using internally a lot. I will ask @LbP22 to help here

LbP22 commented

Hi, thanks for your message! We checked your issue and fixed it, so now it should work for you.

Anyway, here are some guides of simplest implementation of spa-to-http:

  1. https://devforth.io/blog/deploy-react-vue-angular-in-docker-simply-and-efficiently-using-spa-to-http-and-traefik/ - example of usage spa-to-http with traefik
  2. https://github.com/devforth/spa-to-http-demo - demo application
  3. https://drive.google.com/file/d/19d4drkx30HjHxbAEbAsNx9CQXmUBvxAY/view?usp=sharing - small video where I create demo application using tutorial