Static env built with Docker

I tried to use the static web environment, but found out, there’s no support for Yarn 2 (Add Support for Yarn 2 | Feature Requests | Render).
I realize that it’s difficult to support various build environments for static web services. One solution to this could be to use Docker to build the assets and then serve it with a CDN.
I am not very experienced with Docker and also the frontend (JS/TS) world, but in my opinion this could work. Would it be a viable solution?

Hello Stefan!

I believe that your solution should work, yes. If you run into any issues while implementing this, please let us know and we’ll try to help out.

Well, I tried something like this as my build command:

docker run -v $(pwd):/dist alpine "echo 'Hello, World' > dist/index.html"

and then setting ./ as publish directory, but unfortunately, it fails with this error:

bash: docker: command not found

So apparently, there’s no docker in the static env available.

Ah, I’m sorry, I think I misunderstood the original question.

Your solution should work if you run it as a Docker service, but it won’t work as a static env.

Too bad. Hopefully, small annoyances like this will be soon fixed. I keep hitting them quite often lately. :pray:

You have a good point- and thanks for bringing up these annoyances. It helps us to prioritize what we work on fixing, and I definitely want to see our platform as papercut-free as possible.

We’ll work on supporting Yarn 2 so you don’t need a workaround in the first place!

1 Like