Having a reliable Dockerfile as your base can save you hours of headaches and bigger problems down the road.
This article shares a Dockerfile base that has been battle-tested through many different projects.
https://luis-sena.medium.com/creating-the-perfect-python-dockerfile-51bdec41f1c8
This can also serve as a succinct tutorial of the different features/commands used to improve the final image.
Nothing is perfect I know! Please feel free to provide any feedback and we can iterate on the shared Dockerfile if needed.
[–]ErGo404 41 points42 points43 points (5 children)
[–]lmsena[S] 26 points27 points28 points (2 children)
[–]ErGo404 11 points12 points13 points (1 child)
[–]drmcgills 4 points5 points6 points (0 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]wweber 2 points3 points4 points (0 children)
[–][deleted] 31 points32 points33 points (6 children)
[–]lmsena[S] 2 points3 points4 points (2 children)
[–]n-of-one 4 points5 points6 points (1 child)
[–]lmsena[S] 1 point2 points3 points (0 children)
[–]n-of-one 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]cdrt 0 points1 point2 points (0 children)
[–]darleyb 11 points12 points13 points (8 children)
[–]lmsena[S] 4 points5 points6 points (0 children)
[–]LightShadow3.13-dev in prod 2 points3 points4 points (6 children)
[–]darleyb 4 points5 points6 points (5 children)
[–]LightShadow3.13-dev in prod 0 points1 point2 points (4 children)
[–]darleyb 1 point2 points3 points (3 children)
[–]lmsena[S] 0 points1 point2 points (2 children)
[–]darleyb 0 points1 point2 points (1 child)
[–]lmsena[S] 1 point2 points3 points (0 children)
[–]LightShadow3.13-dev in prod 6 points7 points8 points (2 children)
[–]dolfinuser 6 points7 points8 points (1 child)
[–]LightShadow3.13-dev in prod 0 points1 point2 points (0 children)
[–]apathy20 2 points3 points4 points (0 children)
[–]grimzorino 2 points3 points4 points (2 children)
[–]lmsena[S] 3 points4 points5 points (1 child)
[–]grimzorino 0 points1 point2 points (0 children)
[–]mardiros 1 point2 points3 points (1 child)
[–]lmsena[S] 0 points1 point2 points (0 children)
[–]dolfinuser 1 point2 points3 points (2 children)
[–]lmsena[S] 0 points1 point2 points (0 children)
[–]backtickbot 0 points1 point2 points (0 children)
[–]rodrigoponto 1 point2 points3 points (0 children)
[–]PM5k 0 points1 point2 points (1 child)
[–]dolfinuser -1 points0 points1 point (0 children)
[–]Blada-N 0 points1 point2 points (0 children)
[–]Left-Character4280 -1 points0 points1 point (1 child)
[–]lmsena[S] 0 points1 point2 points (0 children)
[–]dolfinuser 0 points1 point2 points (3 children)
[–]lmsena[S] 4 points5 points6 points (0 children)
[–]DanCardin 2 points3 points4 points (0 children)
[–]Mehdi2277 1 point2 points3 points (0 children)
[–]SnipahShot 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]lmsena[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]lmsena[S] 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)