fixes env middleware on router, update dockerfile